Jeff's answer is right. Just a little tip for you. Using EF6, I wrote the following configuration to specify all the fields with the name "Id" and enter "Guid" as a person.
modelBuilder.Properties<Guid>() .Where(info => info.Name.ToLower()== "id") .Configure(configuration => configuration.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity));
Therefore, I do not need to write [DatabaseGenerated(DatabaseGenerationOption.Identity)]
every time.
source share