Hi I have developed model that works perfectly for me, now I want to map it to database using EntityFramework, here is a part of it:
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
public virtual ProductType Type { get; set; }
}
public class Supplier
{
public int Id { get; set; }
public string OIB { get; set; }
public string Name { get; set; }
}
public class SupplierProduct
{
public double Price { get; set; }
public string SupplierMark { get; set; }
public virtual Product Product { get; set; }
public virtual Supplier Supplier { get; set; }
}
Now my question is how do I write entity configuration on ModelBuilder form my DBContext so that it maps on SupplierProduct class ForeignKeys Supllier.ID and Product.Id as Primary key of DB relation.