My project needs to handle three databases, that means three session factories. The thing is if i do something like this with fluent nhibernate:
.Mappings(m => m.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly()))
the factories would pick up all the mappings, even the ones that correspond to another database
I've seen that when using automapping you can do something like this, and filter by namespace:
.Mappings(m => m.AutoMappings.Add(
AutoMap
.AssemblyOf<Product>()
.Where(t => t.Namespace == "Storefront.Entities")))
I havent found anything like this for fluent mappings, is it possible?? The only solutions I can think of are: either create separate assemblies for each db mapping classes or explicitly adding each of the entities to the factory configuration.
I would prefer to avoid both, if possible. Thanks.