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 |
|
d2cda293-1e2f-4878-af0e-5aaf0d092120 |
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.
-
Add the xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A property to the xref:System.Data.Linq.Mapping.ColumnAttribute attribute.
-
Set the xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A property value to
Always
.
-
Add the xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A property to the xref:System.Data.Linq.Mapping.ColumnAttribute attribute.
-
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
-
Add the xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A property to the xref:System.Data.Linq.Mapping.ColumnAttribute attribute.
-
Set the xref:System.Data.Linq.Mapping.ColumnAttribute.UpdateCheck%2A property value to
WhenChanged
.
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]