2

When I try to remove, using entity framework i have the following error:

"The property 'User_ID' is part of the object's key information and cannot be modified."

Here is my code:

var rowToRemove = context.UD_User_Role.Where(w => w.User_ID == userId).ToList();
    context.UD_User_Role.RemoveRange(rowToRemove);

and here is my table's design:

enter image description here

Wekerle Tibor
  • 457
  • 2
  • 7
  • 19

0 Answers0