4
Answers

A many to many relationship on the same table

public class Product
{
 public int Id { get; set; }
 public string Name{ get; set; }
// lotsa other stuff
 public ICollection<Product> RelatedProduct{ get; set; }
}

Hi, 

Let's say I have a table "Product"

That table has a collection of 'Related Products'

Ho do I configure it on the DbContext fulent api so it creates the link table?

One product can be in many "relatedproducts" and each product can have many "relatedproducts"

Answers (4)