title: Mapping a list of implementations of an interface with Fluent NHibernate
body: <p>I get the following error when using the below mappings:</p>
  
  <p><code>NHibernate.MappingException: Association references unmapped class: GeoTriggers.Domain.Entities.ITrigger</code></p>
  
  <p>Entities:</p>
  
  <pre><code>public class Profile
  {
      public virtual int Id { get; set; }
      public virtual string Password { get; set; }
      public virtual string Username { get; set; }
      public virtual IList&lt;ITrigger&gt; Triggers { get; set; }        
  }
  
  public interface ITrigger
  {
      int Id { get; set; }
      decimal Latitude { get; set; }
      decimal Longitude { get; set; }
      decimal Radius { get; set; }
  }
  
  public class EmailTrigger : ITrigger
  {
      public virtual string RecipientAddress { get; set; }
      public virtual string SenderAddress { get; set; }
      public virtual string Subject { get; set; }
      public virtual string Body { get; set; }
  
      #region ITrigger Members
  
      public virtual int Id { get; set; }
      public virtual decimal Latitude { get; set; }
      public virtual decimal Longitude { get; set; }
      public virtual decimal Radius { get; set; }
  
      #endregion
  }
  </code></pre>
  
  <p>Using the following class maps:</p>
  
  <pre><code>public sealed class ProfileMap : ClassMap&lt;Profile&gt;
  {
      public ProfileMap()
      {
          HasMany(x =&gt; x.Triggers).Cascade.All();
      }
  }
  
  public sealed class TriggerClassMap : ClassMap&lt;ITrigger&gt;
  {
      public TriggerClassMap()
      {            
      }    
  }
  
  public sealed class EmailTriggerClassMap : SubclassMap&lt;EmailTrigger&gt;
  {
      public EmailTriggerClassMap()
      {            
      }
  }
  </code></pre>
  
  <p>Using the following FluentNHibernate configuration:</p>
  
  <pre><code>FluentConfiguration fluent = Fluently.Configure(_configuration)
                  .Mappings(
                      x =&gt; x.AutoMappings.Add(
                          AutoMap.Assemblies(typeof (TEntity).Assembly).Where(
                              assembly =&gt; assembly.Namespace.Contains("Entities"))));
  </code></pre>
  
  <p>All my entities are in a namespace that includes the word "Entities". I did this to avoid having to make all my entities inherit from a common base. </p>
  
  <p>I am trying to keep my configuration to a minimum, so I have opted to allow Fluent NHibernate to run free with its default conventions. Normally, I don't even have class map files. But, now, since I'm trying to map a list of objects that implement a common interface, it has gotten sticky.</p>
  
  <p>The error says that an association (I assume the one-to-many in the ProfileMap) references an unmapped class (ITrigger). According to the docs, it sounds like all I need to have is a class map for the base/interface and subclass maps for the implementations. I have that. What am I missing?</p>