ConflictMode ConflictMode ConflictMode ConflictMode Enum

定义

指定应何时报告并发冲突。Specifies when concurrency conflicts should be reported.

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

字段

ContinueOnConflict ContinueOnConflict ContinueOnConflict ContinueOnConflict 1

指定应尝试对数据库的所有更新,并且应在该过程结束时累积和返回并发冲突。Specifies that all updates to the database should be tried, and that concurrency conflicts should be accumulated and returned at the end of the process.

FailOnFirstConflict FailOnFirstConflict FailOnFirstConflict FailOnFirstConflict 0

指定当检测到第一个并发冲突错误时,应立即停止对更新数据库的尝试。Specifies that attempts to update the database should stop immediately when the first concurrency conflict error is detected.

示例

db.SubmitChanges(ConflictMode.FailOnFirstConflict)  
db.SubmitChanges(ConflictMode.FailOnFirstConflict);  
Northwnd db = new Northwnd("...");

// Create, update, delete code.

db.SubmitChanges(ConflictMode.FailOnFirstConflict);
// or
db.SubmitChanges(ConflictMode.ContinueOnConflict);
Dim db As New Northwnd("...")

' Create, update, delete code.

db.SubmitChanges(ConflictMode.FailOnFirstConflict)
' or
db.SubmitChanges(ConflictMode.ContinueOnConflict)

适用于