dotnet / dotnet/efcore

Migration for linq To sql with updateCheck

Open
#32,045 2 comments 0 reactions 0 assignees View on GitHub
area-model-building area-save-changes customer-reported
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

We will migrate a application that use linq to sql updatecheck = WhenChanged for concurrency for all column except some always.
See https://learn.microsoft.com/fr-fr/dotnet/api/system.data.linq.mapping.columnattribute.updatecheck?view=netframework-4.8.1
I do not seen any solution to do this in EF core (except always => ConcurrencyCheck).

Example
a record with with fields : Id, A, B
Each user 1/ 2/ get the record, 1/ update the field A, and save, 2/ update the field B (A is not touched), it can save too without conflict. But if 2/ change A too => it detects a conflict.

My only idea for now, it is to mark all field with concurrencycheck, if there is an conflict, check field that other user has changed and change the current/original value and resave but i think it is some "barbare" way. ((if changed too by user => show user conflict to accept or to cancel))

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.