One of the best options provided by LINQ concurrency system is control of concurrency behavior at field level. There are three options we can specify using the ‘UpdateCheck’ attribute: -
• Never: - Do not use this field while checking concurrency conflicts.
• Always: - This option specifies that always use this field to check concurrency conflicts.
• WhenChanged :- Only when the member value has changed then use this field to detect concurrency conflicts.
Below is the code snippet which show how we can use the ‘UpdateCheck’ attribute to control property / field level concurrency options as specified above.
[Column(DbType = "nvarchar(50)",UpdateCheck=UpdateCheck.Never)]
public string CustomerCode
_CustomerCode = value;
Asked In: Many Interviews |