You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes, it happens that we are only interested in one side of a many-to-many relationship. So, there would be only one navigation property in one of the entries.
This is a question asked on stackoverflow and the accepted answer is this which uses an empty version of WithMany (Entity Framework):
modelBuilder.Entity<User>().HasMany(u => u.StarredWidgets).WithMany()// <- no parameter here because there is no navigation property.Map(m =>{ m.MapLeftKey("UserId"); m.MapRightKey("WidgetId"); m.ToTable("UserWidgets");});
Is it possible to add support for defining this kind of relationship?
The text was updated successfully, but these errors were encountered:
Sometimes, it happens that we are only interested in one side of a many-to-many relationship. So, there would be only one navigation property in one of the entries.
Example:
This is a question asked on stackoverflow and the accepted answer is this which uses an empty version of
WithMany
(Entity Framework):Is it possible to add support for defining this kind of relationship?
The text was updated successfully, but these errors were encountered: