Fluent API: defining one to many
Models classes :
Mappings:
So I've commented out one, each time and ran the database, keeping one at the time,
appears i get the same results
so here are my questions:
Mappings:
So I've commented out one, each time and ran the database, keeping one at the time,
builder.HasMany<ShippingAddress>(c => c.ShippingAddressNavigation).WithOne(s => s.CustomerNavigation).HasForeignKey(s => s.CustomerId);builder.HasOne<Customer>(S => S.CustomerNavigation).WithMany(c => c.ShippingAddressNavigation).HasForeignKey(a=>a.CustomerId);appears i get the same results
so here are my questions:
- is there any difference between defining the relationship from Customer or ShippingAddress that I've failed to observe? Am I right to assume I'm achieving the same thing just from different side of the relationship?
- is one way better in terms of anything (convention, readability, etc)?