title: CompositeId causes Could not compile the mapping document error
body: <p>I am trying to use CompositeId to map to a legacy system. The source database has a composite primary key so I can't use the normal this.Id mapping. </p>
  
  <p>Here is my attempt to map it:</p>
  
  <pre><code>public PriorityListPartMap()
  {
      this.Schema("EngSchedule");
  
      this.Table("vPriorityListPart");
  
      this.CompositeId().KeyProperty(x =&gt; x.AssemblyPartNumber).KeyProperty(x =&gt; x.PartNumber);
  
      this.Map(x =&gt; x.CurrentDueDate);
  
      this.Map(x =&gt; x.OrderLine);
  
      this.Map(x =&gt; x.OrderNumber);
  
      this.Map(x =&gt; x.PartDescription);
  
      this.Map(x =&gt; x.ProductCode);
  
      this.Map(x =&gt; x.Revision);
  }
  </code></pre>
  
  <p>When I try to create the session factory this mapping causes the error:
      Could not compile the mapping document: (XmlDocument)</p>
  
  <p>I tried removing the CompositeId mapping and replaced it with:</p>
  
  <pre><code>this.Id(x =&gt; x.AssemblyPartNumber).GeneratedBy.Assigned();
  </code></pre>
  
  <p>The error goes away with that mapping but I can't really use that since the AssemblyPartNumber is not unique.</p>
  
  <p>Is there a different way to map to a table with a composite primary key?</p>
  
  <p>Thanks,</p>
  
  <p>Matthew MacFarland</p>