c# - Entity Framework Mapping from One side -
suppose have following
public class post { public int32 postid{get;set;} public string posttext{get;set;} } public class comment { public int32 commentid{get;set;} public string commenttext{get;set;} public post post{get;set;} }
what correct way create fluent configuration relationship in entity framework 5? have been trying past hour similar class structure in project working on unable make work in order create database.
should have this:
public class post { [key] public int32 postid { get; set; } public string posttext { get; set; } public virtual icollection<comment> comments { get; set; } } public class comment { [key] public int32 commentid { get; set; } public string commenttext { get; set; } public post post { get; set; } }
Comments
Post a Comment