Allow SQL to generate GUID ID when inserting new row.

http://www.developerhandbook.com/entity-framework/entity-framework-use-a-guid-as-the-primary-key/

For Database First:

If you having your inserts use Guid.Empty rather then generating a new ID see the above article. Using EDMX you need to edit every ID property in the EDMX and set the “StoreGeneratedPattern” to “Identity”.

Set the database table’s Id ‘s default property¬†newsequentialid().

 

For Code First:

In code first, rather than editing the EDMX, you simply put this attribute on each of your Id fields:

[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id{ get;set; }