title: Entity Framework 6 GUID as primary key: Cannot insert the value NULL into column 'Id', table 'FileStore'; column does not allow nulls
body: <p>I have an entity with primary key "Id" which is Guid:</p>
  
  <pre><code>public class FileStore
  {
      public Guid Id { get; set; }
      public string Name { get; set; }
      public string Path { get; set; }
  }
  </code></pre>
  
  <p>And some configuration:</p>
  
  <pre><code>protected override void OnModelCreating(DbModelBuilder modelBuilder)
  {
      modelBuilder.Entity&lt;FileStore&gt;().Property(x =&gt; x.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
      base.OnModelCreating(modelBuilder);
  }
  </code></pre>
  
  <p>When I try to insert a record I get a following error:</p>
  
  <blockquote>
    <p>Cannot insert the value NULL into column 'Id', table 'FileStore'; column does not allow nulls. INSERT fails.\r\nThe statement has been terminated.</p>
  </blockquote>
  
  <p>I don't want to generate Guid manually. I just want to insert a record and get <code>Id</code> generated by SQL Server. If I set <code>.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)</code>, <code>Id</code> column is not Identity column in SQL Server.</p>
  
  <p>How can I configure Entity Framework to autogenerate Guid in SQL Server?</p>