0

When I try to Map 2 tables with many to many relationship, I only get option .WithOne() but not getting .WithMany() ? enter image description here

Here are those 2 classes.

public class Proizvod
{
    public int Id { get; set; }
    public String Naziv { get; set; }
    public ICollection<Racun> Racuni { get; set; }

    public Proizvod()
    {
        this.Racuni = new List<Racun>();
    }

}

    public class Racun
{
    public int Id { get; set; }
    public List<int> Kolicina { get; set; }
    public ICollection<Proizvod> Proizvodi { get; set; }

    public Racun()
    {
        this.Proizvodi = new List<Proizvod>();
        this.Kolicina = new List<int>();
    }
}
arma_best
  • 65
  • 1
  • 2
  • 13
  • 1
    Doesn't answer your question, but I'd recommend just creating the intermediate many-to-many join table RacunProizvod and entity. This will mean each side is a one-to-many and you can join through this table to represent the many-to-many. In my opinion this is more straightforward. – AaronLS Oct 31 '17 at 17:38
  • Well I will definitely try that. Thanks for comment @AaronLS – arma_best Oct 31 '17 at 17:41

0 Answers0