How to generate entity classes from nhibernate mapping files during runtime
i need some help with c# and nhibernate. I'm working on a project that requires the entity classes to be generated from hbm files at runtime. I get the mapping files from a service, and then need to generate the classes dynamicaly and configure nhibernate to use them.
The problem is that i'm new to nhibernate and not much of a pro in c#, so me writing the piece of code that achieves this 开发者_如何学运维is very error-prone.
I was wondering if you know of any open source software that i could use. Worst case scenario (if can't find anything that even remotely resembles what i need), do you guys have some advice on where should i start? Maybe some links ?
Thanks, Denis.
This is a fairly non-trivial task. There's the hbm2net project you could take a look at, but it's still in alpha and I don't know if it would easily let you do it at runtime.
You should also take a look at the NHibernate Workbench project, it seems to be doing something similar to what you're doing.
精彩评论