Extending fluent nhibernate mappings in another assembly
- by Jarek
Hi, I'm using NHibernate with my ASP.Net MVC application.
I'm writing some extensions (plugins) for my application. And I'm loading those plugin dynamically (from different assemblies).
In my base application I have many entities and mappings defined (User, Group, etc...)
I need to create new entities in my extensions, so i.e. I'm creating News module, so I need to create News mapping.
In database News table has a foreign key to User table.
Is there any way I can modify my User mapping, so it will have:
HasMany(x => x.Courses)
.KeyColumn("GroupId")
.Inverse();
Or the only way to do it is to change code in my User class and recompile project ?
I'm not NHibernate advanced user, so any help will be appreciated.
TIA.