How to automate setting ConcurrencyMode=Fixed on all RowVersion columns?

前端 未结 7 1435
攒了一身酷
攒了一身酷 2021-01-04 13:03

EF defaults to no concurrency control (last write wins) which allows lost updates. Enforcing optimistic concurrency checks can explicitly be configured by setting Concurrenc

7条回答
  •  庸人自扰
    2021-01-04 13:12

    When you have added ConcurrencyMode=Fixed once in your edmx file, then afterwards every time you update your model, before checkin in code (assuming you have some version control life TFS setup), compare with the latest version and merge changes accordingly. This way you dont have to update every single line manually. Not the best way, but better than doing it manually atleast.

提交回复
热议问题