title: C# - Fluent NHibernate mapping question
body: <p>Is there a way to avoid the explicit <code>Id</code> mapping in <a href="http://fluentnhibernate.org/" rel="nofollow">Fluent NHibernate</a>?</p>
  
  <p><em>I want it to somehow generate the entry id automatically so that I wouldn't have to introduce it as a part of the class.</em></p>
  
  <pre><code>public class HeyMapping
  {
      public String Name { get; set; }
      public DateTime Timestamp { get; set; }
  }
  
  public class HeyMapping : ClassMap&lt;HeyMapping&gt;
  {
      public HeyMapping()
      {
          Not.LazyLoad();
  
          // I'm not particularly sure how this line works, but
          // it fails the mapping unit test.
          CompositeId().KeyProperty(x =&gt; x.Name);
  
          Map(x =&gt; x.Name).Not.Nullable().Length(64);
          Map(x =&gt; x.Timestamp).Not.Nullable();
      }
  }
  </code></pre>