An identity column is a SQL Server column whose values the database generates and increments automatically. In the BoardGames table, EF Core assigns this behavior to the Id primary-key column. section 5.3.6
When IDENTITY_INSERT is OFF, inserting an explicit Id value fails. Seeding CSV records therefore requires either omitting Id and accepting new values or temporarily allowing explicit identity values. section 5.3.6
Preserving imported IDs during seeding
Wrap the save operation in a transaction, set IDENTITY_INSERT BoardGames ON, call SaveChangesAsync, turn the setting OFF, and commit. This preserves the CSV identifiers while allowing SQL Server to accept them. section 5.3.6
