this.HasRequired(t => t.Parent)
.WithMany(t => t.Children)
.HasForeignKey(d => d.ParentId);
Here I defined a basic 1-to-many relationship. What if I do not want to have Children property exposed at all in Model, but still want to have synchronization of values between Parent and ParentId. How would I go defining such “relationship”?
You will call
WithManywithout any parameter: