我有课
public class BlogPost
{
public int Id {get;set;}
public string Body{get;set;}
public IList<Comment> Comments{get;set;}
//other properties
}
public class Comment
{
public int Id {get;set;}
public int TypeId {get;set;}
public int BlogPostId {get;set;}
public DateTime DateAdd {get;set;}
public string Body {get;set;}
//other properties
}
所以我们有一些 BlogPost 集合,其中每个 BlogPost 可以有很多评论。
我想收集最后一条评论的所有博客帖子(这与 MAX(DateAdde) 是 TypeId=1 或 TypeId=2。提前致谢。