我有“的字符串,DeviceInfo”,其中DeviceInfo是包含一些属性一类的字典,如下图所示:使用LINQ以选择它们匹配列表,表中的项目
public string Name { get; set; }
public string Id { get; set; }
public bool Actioned { get; set; }
我需要使用LINQ实体从字典中的DeviceInfo“Name”属性中存在表中的deviceId的表中选择设备详细信息。类似于以下的是我所追求的。不幸的是我的代码不起作用。任何人都会告诉我我要去哪里?
from t in _context.Devices where list.Select(x => x.Value.Name).Contains(t.DeviceId) select t
你用'.Contains(“”+ t.DeviceId)''试过了吗?我不确定它是否会这样工作,但它值得一试。 – IronMan84 2013-04-11 15:36:25