我正在使用以下linq查询:
var docList = from c in container.DocumentDeliveryPreferences
join o in container.Documents on c.DocumentId equals o.DocumentId
select new { o.Name, o.DocumentType, c.CustomerId };
如何修改此选项以仅选择c.CustomerId等于X(某些参数)的文档?
答案 0 :(得分:2)
您可以尝试以下方法:
var docList = from c in container.DocumentDeliveryPreferences
join o in container.Documents
on c.DocumentId equals o.DocumentId
where c.CustomerId == X
select new { o.Name, o.DocumentType, c.CustomerId };
其中X
是您的参数。