Code First migration from int to Guid primary key issue
问题 I'm trying to change my code first ID column from 'int' to 'Guid', and when trying to run the migration, I get the message: Identity column 'CustomFieldId' must be of data type int, bigint, smallint, tinyint, or decimal or numeric with a scale of 0, and constrained to be nonnullable. I'm defining the column like this: public partial class CustomField : BaseEntity { [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public Guid CustomFieldId { get; set; } Mapping it in