refactorthis/GraphDiff — pull request #39 by andypelzer (2014-02-01 16:20:56+00:00)
Title: Added a test ensuring that Guid keys work

I've been able to reproduce the errors reported with issue #32. The reported behavior seems to be caused by Entity Framework, not GraphDiff though.
EF doesn't default to *DatabaseGenerated(DatabaseGeneratedOption.Identity)* for keys of type Guid so their values remain Guid.Empty after saving. This turns a lot of tests expecting valid Ids red. Adding the *DatabaseGenerated* attribute still leaves a couple of tests red with an *UpdateException* stating that "A dependent property in a referential constraint is mapped to a store-generated column". This exception indicates that the relations aren't properly mapped, asking Entity Framework to map a foreign key to a store generated field which it doesn't support.

Adding the DatabaseGenerated attribute to an Entity.Id of type int as an experiment also breaks a lot of tests - which I had expected as the models aren't written with that in mind. It seems the problems are neither caused by GraphDiff nor by using Guids, so I'll stop investigating here for now.

I've added a test showing that Guids and one-to-one-owned relations generally do work with GraphDiff.