Hi
I have two classes and they both implements IAdministrator. I'm trying to map against this interfaces but i ends up with a "NHibernate.MappingException: Unknown entity class: Client1.BLL.Administrator" message"
In this case I have 2 different types of objects, Client1.BLL.Administrator and Client2.BLL.Administrator. To make sure I instansiate the correct type im using a factory which is called from IInterceptor.Instantiate method. It returns the correct type, in this case Client1.BLL.Admi.. And that class does implements the correct interface IAdministrator. The reason I have choosed this approach is that different clients will have different business rules, eg. length of password, so I need two types of objects.
I could have more than one mapping file, one for each object type but then I get problems in my repositories when I shall write the queries.
eg. from Client?.BLL.Admin.. where ..
I used a subclass instead. Works as it should now.. almost :)
|