我需要 EF 中一个表的 ColumnName,我有它的 ID。我的表是这样的:
零售商
[RetailerId] [int] IDENTITY(1,1) NOT NULL,
[RetailerName] [varchar](50) NOT NULL,
[StateName1] [bit] NOT NULL,
[StateName2] [bit] NOT NULL,
[StateName3] [bit] NOT NULL,
状态
[SId] [int] IDENTITY(1,1) NOT NULL,
[StateName] [varchar](50) Not Null
我从一个函数收到一个SId,需要选择位于该州的所有零售商。就像是:
var listOfRetailers = (from m in db.Retailers where m.[a column that it's id is equal to SId] == true select m ).toList();