Hi,
I have an asp.net core app having two table product and variant without foreign keys (in sqlite) defined like
class Product{
public string Codart {get;set;}
public decimal Price {}
...
}
class Variant{
public string Codart {get;set;}
public string CodVar {get;set;} // kind of measure S,M,L,X,...
}
I create a folder ViewModel and i put a class
class ProductView {
public Product Product {}
public IEnumerable<Variant>
}
Variants are different from every product and not every product has variants.
I want display product once and under the variants.
What is right way (OOP) to populate the view Model?