【发布时间】:2021-01-05 08:24:22
【问题描述】:
我想从数据库中选择特定的 ResourceId 和 projectId 行。
当传递一个包含一些 projectId 和 ResourceId 的列表时,我得到一个错误:
LINQ to Entities 无法识别方法 'SyncRms.Services.RequiredData get_Item(Int32)' 方法,并且该方法无法转换为存储表达式。
代码:
for (int i = 1; i <= List.Count; i++)
{
Guid RId = (Guid)List[i].ResourceId;
// I get the error on this line of code
var result = db.External_Timesheet.Where(x=>x.ResourceId.Equals(int(List[i].ResourceId))&&x.ProjectId.Equals(List[i].ProjectId));
}
【问题讨论】:
标签: c# list datatable where-clause