I use EF with the code first in my project and face problem when data with a user id is inserted.
When I try to insert data with a user identifier (for example, 999), EF ignores it and inserts an indexed identifier into the table.
My model:
public class Address { [Key] public int Id { get; set; } public string FirstName { get; set; } ... }
How to solve this problem?
EDIT:
1) How to start an increment from N, but not from 0?
2) If I do not specify a user identifier, the DB must increment and insert its own. If I specify a special identifier, DB should insert it. Is it possible?
Serhii kyslyi
source share