Many-to-many relationship with duplicate entries
问题 I'm trying to build a many to many relationship using the entity framework and fluent API, but I'm stuck trying to allow duplicate entries. Here is what I have: public class Pizza { public int PizzaId { get; set; } public virtual ICollection<Topping> Toppings { get; set; } } public class Topping { public int ToppingId { get; set; } } Any pizza should be able to have multiple toppings. Any topping can be applied to multiple pizzas. So in OnModelCreating() I call: modelBuilder.Entity<Pizza>()