ChangeAction 枚举

定义

描述在将更改提交到数据库时实体将具有的更改的类型。Describes the type of change the entity will undergo when changes are submitted to the database.

public enum class ChangeAction
public enum ChangeAction
type ChangeAction = 
Public Enum ChangeAction
继承
ChangeAction

字段

Delete 1

将删除该实体。The entity will be deleted.

Insert 2

将插入该实体。The entity will be inserted.

None 0

将不会提交该实体。The entity will not be submitted.

Update 3

将更新该实体。The entity will be updated.

示例

void OnValidate(ChangeAction action)
{
    if (action == ChangeAction.Insert)
    {
        Console.WriteLine("Notify billing office.");
    }
}
Public Sub OnValidate(ByVal action As System.Data.Linq.ChangeAction)
    If action = ChangeAction.Insert Then
        Console.WriteLine("Notify billing office.")
    End If
End Sub

注解

在应用OnValidate()程序LINQ to SQLLINQ to SQL中将与结合使用, 以根据要提交的更改类型来指定或忽略验证。Use with OnValidate() in LINQ to SQLLINQ to SQL applications to specify or omit validation based on the type of change being submitted.

适用于