Error while accessing the Navigation Property in EF Code First
问题 I am having a simple ViewModel which have something like this... ViewModel public class UserPostCommentViewModel { public virtual List<Comment> Comment { get; set; } public virtual User User { get; set; } public virtual Post Post { get; set; } } so that i can return a view which has 1 Post with the details 1 User details and Many Comments submitted by users.... POST [Key] [ScaffoldColumn(true)] public int PostID { get; set; } [Required(ErrorMessage="Required")] [StringLength(250)] public