Update Unique keys in Entity Framework
I have one view and one of its fields is Email (UK-Unique Key).
When some user do login in my web system and update the email. Happens one problem he can't change his email.
After Appears the message:"the property is part of the object's key information and cannot be开发者_高级运维 modified"
I don't think you can or should update unique key fields. Have you considered making an integer identity field the unique key for the user, so that the email address could be modified?
You can still enforce uniqueness of the email field by adding an additional constraint in the database, or through business logic.
精彩评论