public class Article
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; set; }
...
public virtual ICollection<Comment> comm { get; set; }
}
public class Comment
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; set; }
public Guid ArtId { get; set; }
...
[ForeignKey("ArtId")]
public virtual Article art { get; set; }
}
public class Article
{
...
public List<Comment> CommentList { get; set; }
public Article()
{
CommentList = new List<Comment>();
}
...
}
public class Comment
{
public int ID { get; set; }
public int ParentID { get; set; }
public string FullText { get; set; }
public string Author { get; set; }
public string Email { get; set; }
public DateTime DatePublication { get; set; }
public Article Article { get; set; }
...