Extending fluent nhibernate mappings in another assembly
Posted
by Jarek
on Stack Overflow
See other posts from Stack Overflow
or by Jarek
Published on 2010-05-03T21:13:17Z
Indexed on
2010/05/03
21:18 UTC
Read the original article
Hit count: 205
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.
© Stack Overflow or respective owner