[英]How to use Entity Framework include with condition?
假設我們有兩個實體, Posts和Comments 。 帖子具有“ 評論”的導航屬性,反之亦然:
public virtual ICollection<Comment> Comments { get; set; }
而且Comment具有User的導航屬性:
public virtual User User { get; set; }
現在,如何查詢僅包含最后評論(按評論創建日期)和創建它的用戶的所有帖子 ?
當前版本的EF無法實現,但是您可以在此處投票https://entityframework.codeplex.com/workitem/47
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.