I have the following code for two classes:
public class Object { public int ObjectID { get; set; } public int Object2ID { get; set; } public virtual Object2 Object2 { get; set; } } public class Object2 { public int Object2ID { get; set; } public virtual ICollection<Object> Objects { get; set; } }
I know that with the Entity Framework this will create a one-to-many relationship, but I want to know how to convert this to a zero-to-many relationship.
I am new to Entity Framework and I have not found a direct answer.
c # entity-framework relationships
Jorge díaz
source share