ColumnAttribute.UpdateCheck Property

Definition

Gets or sets how LINQ to SQL approaches the detection of optimistic concurrency conflicts.

public System.Data.Linq.Mapping.UpdateCheck UpdateCheck { get; set; }

Property Value

Default = Always, unless IsVersion is true for a member.

Other values are Never and WhenChanged.

Examples

[Column(Storage="_CustomerDesc", DbType="NText", UpdateCheck=UpdateCheck.Never)]
public string CustomerDesc
{
    get
    {
        return this._CustomerDesc;
    }
    set
    {
        if ((this._CustomerDesc != value))
        {
            this.OnCustomerDescChanging(value);
            this.SendPropertyChanging();
            this._CustomerDesc = value;
            this.SendPropertyChanged("CustomerDesc");
            this.OnCustomerDescChanged();
        }
    }
}

Remarks

When this property is used with one of three enums, it determines how LINQ to SQL detects concurrency conflicts.

If no member is designed as IsVersion=true, original member values are compared with the current database state.

The following enums are available:

  • Always Always use this column for conflict detection.

  • Never Never use this column for conflict detection.

  • WhenChanged Use this column only when the member has been changed by the application.

Applies to

Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1