Autogenerate primary key (Guid) Entity Framework CTP5
问题 I have a following POCO class public class Account { [Key,DatabaseGenerated(DatabaseGenerationOption.Identity)] public string AccountId { set; get; } public string FirstName { set; get; } public string LastName { set; get; } public string Email { set; get; } } I get the following exception when the database gets created Identity column 'AccountId' must be of data type int, bigint, smallint, tinyint, or decimal or numeric with a scale of 0, and constrained to be nonnullable. 回答1: Shouldn't you