SaveChangesOptions 列舉


表示呼叫 SaveChanges() 時的變更選項。Indicates change options when SaveChanges() is called.

此列舉有 FlagsAttribute 屬性,因此其成員值可進行位元組合。

public enum class SaveChangesOptions
public enum SaveChangesOptions
type SaveChangesOptions = 
Public Enum SaveChangesOptions


Batch 1

所有暫止的變更都會儲存在單一批次要求中。All pending changes are saved in a single batch request.

ContinueOnError 2

暫止的變更是透過多個伺服器要求來儲存,而且在發生錯誤後繼續作業。Pending changes are saved by using multiple requests to the server, and the operation continues after an error occurs.

None 0

暫止的變更是透過多個伺服器要求來儲存,但在第一次失敗時停止作業 (預設值)。Pending changes are saved by using multiple requests to the server, but the operation stops on the first failure (default).

ReplaceOnUpdate 4

暫止更新是透過將資料來源中實體的所有值取代成更新實體的值 (HTTP PUT) 來完成,而不只是更新變更的值 (HTTP MERGE) (這是預設行為)。Pending updates are made by replacing all values of the entity in the data source with values from the updated entity (HTTP PUT) instead of just updating changed values (HTTP MERGE), which is the default behavior.


已設定 ContinueOnError 選項時,即使發生錯誤後,仍將嘗試後續作業。When the ContinueOnError option is set, subsequent operations are still tried even after an error occurs.

未使用批次處理時, DataServiceResponse.BatchHeaders 屬性會傳回空集合,而且 DataServiceResponse.BatchStatusCode 屬性為零。When batching is not used, the DataServiceResponse.BatchHeaders property returns an empty collection, and the DataServiceResponse.BatchStatusCode property is zero.

您不能同時設定 BatchContinueOnErrorYou cannot set both Batch and ContinueOnError at the same time.