I ran into a problem when creating a new app. The app is about new employees that enter on a specific date. As they need some Hardware (such as Notebooks, keyboards etc.) we want to provide an overview over all the new employees that are going to come in the next few days.
So there are the following Models:
Entry:
public class Entry{
public IEnumerable<Hardware> Hardware {get; set;}
...
}
Hardware:
public class Hardware{
public string Name {get; set;}
public OrderStatus Status {get; set}
}
OrderStatus:
public enum OrderStatus{
Nothing,
Ordered,
Arrived,
Ready
}
At first this seemed fine because for every entry I wanted to create a new Hardware dataset (one to many). Now I decided to maintain a list of Hardware and just reference the Hardware to the Entry (many to many). The problem is that the OrderStatus is bound to the Hardware so when one Hardware is referenced to many Employees and the Orderstatus gets changed it will be changed on all entries.
I think the proper solution would be to use a third table (Entry_Id, Hardware_Id, OrderStatus). With fluent API it's possible to map a relationship in a new (third) table but it's not possible to add a new property (OrderStatus) to it. Is this even possible?