1

I am working on a legacy web app which implements model first(edmx file) approach using Entity Framework.

I need to implement optimistic concurrency, so I have added this field as following:

enter image description here

and inside the database has been created as binary(8) type. But when I try to update the entity is getting updated but the VersionRow values is not updated(no new value generated).

P.S

When I added the column I have binded default value as 0x0000000000000000 because it does not allow null values.

1 Answer 1

2

Yea I solved it this way:

1) I changed the type of RowVersion column from Binary(10) into timestamp inside SqlServer.

2) In the property details inside the .edmx file I have put the property StoreGeneratedPattern of the property RowVersion as Computed.

Computed it means that a new value is generated on insert and update.

Now it became as following:

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.