title: fluentNhibernate: how to add an extra attribute to a relationship (aka relationship attribute)
body: <p>I have two entities, Albums and Photos, with  a many-to-many relationship between then. Its all working fine. What I want is to add an relationship attribute i.e. an extra attribute to the mapping besides album_id and photo_id, for example the datetime the photo was added or an attribute that says if the photo is visible or not on that album.</p>
  
  <pre><code>public class Photo
  {   public virtual int Id { get; set; }
      public virtual string Title { get; set; }
      public virtual ICollection&lt;Album&gt; Albums { get; set; }
  }
  
  public class Album
  {
  public virtual int Id {get;set;}
      public virtual string Title {get;set;}
      public virtual ICollection&lt;Photo&gt; Photos { get; set; }
  }
  </code></pre>
  
  <p>The current mapping goes like this:</p>
  
  <pre><code>public class PhotosMap : ClassMap&lt;Photo&gt;
  {
     public PhotosMap()
        {
           Id(x =&gt; x.Id);
           Map(x =&gt; x.Title); 
           HasManyToMany&lt;Album&gt;(x =&gt; x.Albums).Not.LazyLoad().Table("album_photos");               
           Table("photos");
        }
  }
  
  public class AlbumsMap : ClassMap&lt;Album&gt;
  {
     public AlbumsMap()
       {
           Id(x =&gt; x.Id);
           Map(x =&gt; x.Title);                
           HasManyToMany&lt;Photo&gt;(x =&gt; x.Photos).Inverse().Not.LazyLoad().Table("album_photos");
           Table("album");
       }
   }
  </code></pre>