I have an "Item" table defined as such:
item_id
Name
Description
itemseries_id
itemtype_id
itemcondition_id
And then I have "ItemForSale" table:
itemforsale_id
item_id
price
date_added
Entities:
public class Item
{
public int ItemId { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public int ItemSeriesId { get; set; }
public ItemSeries ItemSeries { get; set; }
public int ItemConditionId { get; set; }
public ItemCondition ItemCondition { get; set; }
public int ItemTypeId { get; set; }
public ItemType ItemType { get; set; }
public List<ItemTag> ItemTags { get; set; }
public List<ItemImage> ItemImages { get; set; }
public List<ItemPurchase> ItemPurchases { get; set; }
public List<ItemSale> ItemSales { get; set; }
}
public class ItemForSale
{
public int ItemForSaleId { get; set; }
public decimal Price { get; set; }
public DateTime AddedDate { get; set; }
public int ItemId { get; set; }
public Item Item { get; set; }
}
How would I use the FluentAPI between these? I know I could add a reference to ItemForSale inside the Item entity class, but it doesn't make sense to me. So far I have mapped all of my One-to-one and many-to-many relationships, but the relationship between Item and ItemForSale is just confusing me.
Note: I am distinguishing between items that have been sold as a "Sale" or "ItemSale" and an item up for sale with no buyer as "ItemForSale"