I have created a custom entity, following the basic steps as outlined to me in various posts, through adding the class to Nop.Core.Domain, adding the entity map to Nop.Data.Mapping, adding a new service, and finally developing the UI.
Where I am currently stuck at is INSERTING a record. I am getting the follwing error:
Cannot insert explicit value for identity column in table 'ReorderReminder' when IDENTITY_INSERT is set to OFF
I know this error is due to an attempt to insert an explicit value into the Id field on the table, which is defined as INT IDENTITY(1,1) NOT NULL.
I cannot work out how to address this in the code. As far as I can see my custom entity is the same as the core ones. It inherits BaseEntity. The map identifies the Id as the key:
public ReorderReminderMap()
{
this.ToTable("ReorderReminder");
this.HasKey(reminder => reminder.Id);
I must be missing a step somewhere, but I can't work out where.
Can anyone help..??