Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 3.03 KB

how-to-specify-which-members-are-tested-for-concurrency-conflicts.md

File metadata and controls

49 lines (31 loc) · 3.03 KB
description title ms.date dev_langs ms.assetid
Learn more about: How to: Specify Which Members are Tested for Concurrency Conflicts
How to: Specify Which Members are Tested for Concurrency Conflicts
03/30/2017
csharp
vb
d2cda293-1e2f-4878-af0e-5aaf0d092120

How to: Specify Which Members are Tested for Concurrency Conflicts

Apply one of three enums to the [!INCLUDEvbtecdlinq] xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A property on a xref:System.Data.Linq.Mapping.ColumnAttribute attribute to specify which members are to be included in update checks for the detection of optimistic concurrency conflicts.

The xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A property (mapped at design time) is used together with run-time concurrency features in [!INCLUDEvbtecdlinq]. For more information, see Optimistic Concurrency: Overview.

Note

Original member values are compared with the current database state as long as no member is designated as IsVersion=true. For more information, see xref:System.Data.Linq.Mapping.ColumnAttribute.IsVersion%2A.

For code examples, see xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A.

To always use this member for detecting conflicts

  1. Add the xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A property to the xref:System.Data.Linq.Mapping.ColumnAttribute attribute.

  2. Set the xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A property value to Always.

To never use this member for detecting conflicts

  1. Add the xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A property to the xref:System.Data.Linq.Mapping.ColumnAttribute attribute.

  2. Set the xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A property value to Never.

To use this member for detecting conflicts only when the application has changed the value of the member

  1. Add the xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A property to the xref:System.Data.Linq.Mapping.ColumnAttribute attribute.

  2. Set the xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A property value to WhenChanged.

Example

The following example specifies that HomePage objects should never be tested during update checks. For more information, see xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A.

[!code-csharpSystem.Data.Linq.Mapping.UpdateCheck#1] [!code-vbSystem.Data.Linq.Mapping.UpdateCheck#1]

See also