Using fluent api, how do I map multiple properties of the same data type to a single table conditionally.
Database Model:
- ListType would include the Grouping names i.e. Allergens
- ListItem would include all possible values for the given type
- ProductListItem contains all "selected" values for a given product.
The goal is to use the ProductListItem table and apply it across multiple properties of a model (of the same ProductListItem type) based on the ListType (WHERE ProductListItem.ListTypeID = 1).
public class Product
{
public int ProductID { get; set; }
public List<ProductListItem> Allergens { get; set; }
public List<ProductListItem> DoesNotContain { get; set; }
}