I am working on a project with multiple databases. I want to have all my
entities and mappings in the same assembly (to reduce assembly load time).
So I have
And when creating session factories use like this:
When session factory for Database1 is needed use: only the
.Mappings(x=>x.FluentMappings (add from namespace Project1.Database1)
When session factory for Database2 is needed use: only the
.Mappings(x=>x.FluentMappings (add from namespace Project1.Database2)
This way the mappings loaded are only as needed (thereby reducing the
mappings load time).
I know that I can use AutoMapping and use namespace but I do not want to
use AutoMapping. I have to use FluentMapping.
I know that I can put different databases in different assemblies and then
use AddFromAssemblyOf but that will increase the number of assemblies and I
will prefer not to do that.
Is there any way to do that while in the same project?
Any ideas? Any code samples?