I have three classes
public class User { public int Id { get; set; } public string Name { get; set; } public virtual ICollection<Product> Products { get; set; } } public class Product { public int Id { get; set; } public string Name { get; set; } public virtual ICollection<User> Users { get; set; } } public class ProductXUser // Mapping class { public int Id { get; set; } public int User_Id { get; set; } public int Product_Id { get; set; } public DateTime DateMapped { get; set; } }
How can I map many or many relationships (using the Fluent API) between the User and Product classes using the ProductXUser class as a mapping table?
source share