title: Fluent NHibernate + multiple databases
body: <p>My project needs to handle three databases, that means three session factories. The thing is if i do something like this with fluent nhibernate:</p>
  
  <pre><code>.Mappings(m =&gt; m.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly()))
  </code></pre>
  
  <p>the factories would pick up all the mappings, even the ones that correspond to another database</p>
  
  <p>I've seen that when using automapping you can do something like this, and filter by namespace:</p>
  
  <pre><code>.Mappings(m =&gt; m.AutoMappings.Add(
      AutoMap
         .AssemblyOf&lt;Product&gt;()
         .Where(t =&gt; t.Namespace == "Storefront.Entities")))
  </code></pre>
  
  <p>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. </p>
  
  <p>I would prefer to avoid both, if possible. Thanks.</p>