I have Table
eventid int -- not PK key but with autoincrement
jobid -- PK autoincrement disabled
userid int -- PK autoincrement disabled
To update jobID I do following:
var itemforupdate = context.table.where(n=>n.eventid == someparameter).FirstorDefault()
I get the item from database correctly, but when assigning:
itemforupdate.jobID = 5;
context.SaveChanges();
after context.SaveChanges()
I get the error:
The property 'jobID' is part of the object's key information and cannot be modified
How to update jobID from Entity Framework to solve this problem?