I want to map sth like this using fluent Nhibernate but I am not sure how to map the inventory table
This is the tables I have :
Product (Id,Name, ...)
Warehouse(Id, Name, ...)
Inventory(Product_id, Warehouse_id, StockInHand)
I have map the Product and Warehouse like below
Public ProductMap() {
Id(x => x.Id); Map(x => x.Name); HasManyToMany(x => x.StoresStockedIn) .Cascade.All() .Inverse() .Table("Inventory"); }
public WarehouseMap()
{ Id(x => x.Id); Map(x => x.Name); HasManyToMany(x => x.Products) .Cascade.All() .Table("Inventory"); }
The problem I face is that how can I map the StockInHand (how should the inventory model mapping?).
or are there other way to model this scenario ?
I have read some existing questions but not yet get clear understand what to do.
Thanks