I am currently trying to update using Entity Framework 6 and am having some trouble ginven a PK property in my DB, which I DONT want to edit but cant find the correct way to ignore it.
myobj aux = new obj(){
//code
};
using (var context = new ModelEntity())
{
var item = context.mytable.Find(id);
context.Entry(item).CurrentValues.SetValues(aux);
context.SaveChanges();
}
I get the error: The property 'xxxx' is part of the object's key information and cannot be modified. '
I have searched for some kind of ignore and have found nothing. All I find are EF4 and 5.