title: Using uniqueidentifier SQL column type with Entity framework
body: <p>For my primary key and identity in our Clients table I use <code>uniqueidentifier</code> column with a default value set to newsequentialid(). Inserting new rows through the management tool creates the values for the ID fine. </p>
  
  <p>Inserting from .NET 4 code via EF results into zero GUIDs (00000-0000....) being inserted. I create the entity with new, set some values and perform EF <code>AddToClients</code> (for instance). If debugged, value for the id property shows zero GUID. I do not explicitly set the id via the <code>Guid.NewGuid()</code> in my code because I want to leave it off to the <code>newsequentialid()</code> in SQL Server. The problem is, it doesn't work. The first time the code is executed row gets inserted with zero GUID. The next time it obviously fails and results in primary key violation exception.</p>
  
  <p>How can I get this to work without having to set the GUID in my client code?</p>