title: How to allow auto-imports="true" when we use Nhibernate 3.2's mapping by code?
body: <p>I have to use an HQL query in my project and I've an error : "entity is not mapped".</p>
  
  <p>When I read <a href="https://stackoverflow.com/questions/6577428/nhibernate-hql-entity-is-not-mapped">nHibernate HQL - entity is not mapped</a> or <a href="https://stackoverflow.com/questions/6577428/nhibernate-hql-entity-is-not-mapped">nHibernate HQL - entity is not mapped</a> (or other web site) I can read that I have to use auto-import="true" on each class.</p>
  
  <pre><code>&lt;hibernate-mapping
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   namespace="BusinessObjets" assembly="BusinessObjects"
   xmlns="urn:nhibernate-mapping-2.2" auto-import="true"&gt; ...
  </code></pre>
  
  <p>How can we set up this auto imports when we use mapping by code with nhibernate 3.2 ?</p>
  
  <p>I use that code to load the mapping :</p>
  
  <pre><code>var mapper = new ModelMapper();
  mapper.AddMappings(typeof(Repository).Assembly.GetTypes());
  return mapper.CompileMappingForAllExplicitlyAddedEntities();
  </code></pre>
  
  <p>Regards</p>