The property 'Id' is part of the object's key information and cannot be modified

后端 未结 15 2299
天涯浪人
天涯浪人 2020-11-27 07:02

i\'m using Entity Framework 4.0 and having a silly problem that i can\'t figure out.

I have two tables:

  1. Contact: Id (primary key), Value, ContactTypeId
15条回答
  •  清酒与你
    2020-11-27 07:49

    Just hoping this helps someone else, after struggling for hours with this because i knew i wasnt updating the PK and i definitely had a PK. I had the PK value databound to a menu bar to show the current PK value and this was causing the issue.

提交回复
热议问题