<p>I'm trying to setup the Entity Framework with SQL Server 2008.  I'm using Guids for the keys on my tables.  Is there a way to set it up so the keys are automatically generated by the database?  I tried setting "RowGuid" to true and also set the column's default value to be "(newid())".  Either way the mapped class still needs me to give it a Guid on the C# side.  Any ideas?</p>

Since a Guid is a structure, a null value is never passed so the defaults don't kick in. You could consider a
nullable Guid
: Guid?, though this may cause headaches as mentioned in this post:
Nullable GUID
I found it easier to just initialize the Guid with a new value:
```
```
private Guid _identifier = Guid.NewGuid();
```
```
If it's an existing record, it will be replaced when the object is populated. If not, the initialized value will be inserted.