I came across my first disappointment with Entity Framework 4. It turns out that SQL CE when used with EF4 does not support automatically generated primary keys . I get a System.Data.UpdateException message from OnjectContext.SaveChanges () with this message:
Server keys and server-generated values ββare not supported by SQL Server Compact.
So, now I need to manually generate keys for my objects. Assuming I want to use automatic incremental integer keys, what is the best way to generate and track keys when using Entity Framework? Thank you for your help.
source share