0
votes

Given a POCO Product class:

public class Product {

    public int ProductId {get;set;}
    public string Name {get;set;}

}

how can I enable related products using EF?

Basically, I need to allow product owners to add products that user may also be interested in.

I've tried adapting answer in this question but can't get it to work.

I think I need a link table as a product can have many products a user may be interested.

Many thanks in advance

1
Wouldn't the Product class have a ICollection of Products ? - frictionlesspulley

1 Answers

0
votes

Well, i must have been doing something wrong earlier. I've re-visited option 1 from this answer and its done exactly what i needed.