We are working on a domain where the requirement is that a MemberAgreement varies based on Network and State combination. MemberAgreement has a Template which can be shared by multiple States for a Network.
The way we are modelling the Entities is
public class MemberAgreement
{
public Network Network { get; protected set; }
public List<State> States { get; protected set; }
public Template Template {get; protected set; }
}
The tables are designed as:
Agreement
---------
Id
NetworkId
StateId
TemplateId
In this table Agreement, NetworkId and TemplateId can repeat for different StateIds.
Now, how do I map this in Fluent NHibernate? We have One to Many relation between Network and State and combination of these two has Many to Many relation with Template.
Help is appreciated.
PC