title: Raven DB - Have it Auto Generate its own Key
body: <p>I current have an object that has a public property called Id. When I store the object, I would like the Id to be part of the Data and not become the document Id like it currently does. When creating the document store I only set the connection string.</p>
  
  <pre><code>using (var session = documentStore.OpenSession())
  {
      session.Store(a);
      session.SaveChanges();
  }
  
  
  a can be thought of an object as:
  public class A
  {
      public Guid Id { get; set; }
      //other properties
  }
  </code></pre>
  
  <p>So either I want it to generate a random Id or have both the data and the documentId being the Id property of class A.</p>
  
  <p>EDIT:</p>
  
  <p>So two possibilities:
  1. Document Id = Id and the </p>
  
  <pre><code>Data Section contains:
  {
      data //sorry if the notation is not correct, doing it off of memory
      {
          Id: [my guid] 
          //other properities
      }
  }
  </code></pre>
  
  <p>Or the data containing the Id and Document ID = randomly generated by raven</p>