Redigeeri

Jagamisviis:


ColumnAttribute.UpdateCheck Property

Definition

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

public:
 property System::Data::Linq::Mapping::UpdateCheck UpdateCheck { System::Data::Linq::Mapping::UpdateCheck get(); void set(System::Data::Linq::Mapping::UpdateCheck value); };
public System.Data.Linq.Mapping.UpdateCheck UpdateCheck { get; set; }
member this.UpdateCheck : System.Data.Linq.Mapping.UpdateCheck with get, set
Public Property UpdateCheck As UpdateCheck

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();
        }
    }
}
<Column(Storage:="_CustomerDesc", DbType:="NText", UpdateCheck:=UpdateCheck.Never)>  _
Public Property CustomerDesc() As String
    Get
        Return Me._CustomerDesc
    End Get
    Set
        If ((Me._CustomerDesc = value)  _
                    = false) Then
            Me.OnCustomerDescChanging(value)
            Me.SendPropertyChanging
            Me._CustomerDesc = value
            Me.SendPropertyChanged("CustomerDesc")
            Me.OnCustomerDescChanged
        End If
    End Set
End Property

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