授業があります
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 を使用したすべてのブログ投稿のコレクションを取得したいと思います。よろしくお願いします。