title: Fluent NHibernate automapping not working
body: <p>I have an issue with Fluent NHibernate where automapping isn't picking up the entitites in my web project DLL. Normally I store all entities in a separate assembly and this has always worked. However, this project is rather small so I'm trying to keep it all in one project. However, when I call <code>AutoMap.AssemblyOf&lt;MyEntityType&gt;()</code>, no mappings are created. I'm wondering if this is because the entity lives in the web project assembly which gets loaded from Temporary ASP.NET files folder and not the actual folder where the project lives on disk. Is it a permissions issue or something? I'm not sure where to start debugging...</p>
  
  <p>Example entity:</p>
  
  <pre><code>namespace MyProject.Entities 
  {
      public class Letter : EntityBase
      {
          public string FirstName { get; set; }
          public string LastName { get; set; }
          public string Company { get; set; }
          public string Address1 { get; set; }
          public string Address2 { get; set; }
          public string City { get; set; }
          public string State { get; set; }
          public string Zip { get; set; }
          public string Country { get; set; }
          public string Interest { get; set; }
          public string Section1 { get; set; }
          public string Section2 { get; set; }
          public string Section3 { get; set; }
          public string LetterText { get; set; }
          public int StepNumber { get; set; }
      }
  }    
  </code></pre>
  
  <p>Relevant boostrap code:</p>
  
  <pre><code>   private static ISessionFactory GetSessionFactory()
      {
          var database = MsSqlConfiguration.MsSql2005
              .ConnectionString(Configuration.ConnectionString)
              .DefaultSchema(DEFAULT_SCHEMA)
              .AdoNetBatchSize(BATCH_SIZE);
  
          var mappings = AutoMap.AssemblyOf&lt;Letter&gt;()
              .Where(x =&gt; x.GetType() == typeof(Letter))
              .Conventions.Add
              (
                  ConventionBuilder.Id.Always(x =&gt;
                      x.GeneratedBy.HiLo(HILO_TABLE, HILO_COLUMN, HILO_MAX_LO)),
                  ConventionBuilder.HasMany.Always(x =&gt; x.Cascade.AllDeleteOrphan()),
                  Table.Is(o =&gt; Inflector.Pluralize(o.EntityType.Name)),
                  PrimaryKey.Name.Is(o =&gt; "Id"),
                  ForeignKey.EndsWith("Id"),
                  DefaultLazy.Never(),
                  DefaultCascade.All()
              );
  
          // ...
  </code></pre>
  
  <p>I changed the Where clause to look for the specific type instead of the namespace, but that didn't work either. the mappings object still ends up empty.</p>
  
  <p>Also, the EntityBase class is an empty class but for one property 'Id' which is inherited by all entities.</p>
  
  <p><strong>EDIT:</strong> I moved the entities to their own assembly and am still having the problem, so it's not related to the location of the web project assembly. I'm still quite lost on this one. :(</p>