0
如何包含相關實體,但只選擇頂級1?Linq選擇頂級1相關實體
public EntityFramework.Member Get(string userName)
{
var query = from member in context.Members
.Include(member => member.Renewals)
where member.UserName == userName
select member;
return query.SingleOrDefault();
}
我想你的願望條件包括此功能不存在於EF到目前爲止您可以在這裏上傳:https://entityframework.codeplex.com/workitem/47 – 2014-09-20 12:25:18
可能的重複[如何使用實體框架包括條件?] (http://stackoverflow.com/questions/24380345/how-to-use-entity-framework-include-with-condition) – 2014-09-20 12:26:29