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

前端 未结 7 1393
攒了一身酷
攒了一身酷 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:10

    I got bored with setting ConcurrencyMode manually, so I wrote a tiny utility to automate it. You can either use it to set the mode for certain types (timestamp/rowversion) or for column names matching certain regex patterns.

    http://blog.wezeku.com/2014/04/28/fixefconcurrencymodes/

    https://github.com/wezeku/FixEFConcurrencyModes

提交回复
热议问题