How can you handle concurrency at field level in LINQ to SQL?

In LINQ to SQL, you can also handle concurrency at field level and this is the best way provided by the LINQ. To achieve this you need to define UpdateCheck attribute at field level and it has the following options:

  1. Never: – This option will never check for concurrency conflicts.
  2. Always: – This option will always check for concurrency conflicts.
  3. WhenChanged: – This option will check for concurrency conflicts when the field’s value has been changed.
[Column(DbType = "nvarchar(50)", UpdateCheck = UpdateCheck.Never)]
public string CustomerID {
	set {
		CustomerID = value;
	}
	get {
		return _CustomerID;
	}
}
Tagged , . Bookmark the permalink.

Leave a Reply