SaveChangesOptions 列舉

定義

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

此列舉具有 {0} 個屬性允許以位元方式合併其成員值。

public enum class SaveChangesOptions
[System.Flags]
public enum SaveChangesOptions
type SaveChangesOptions = 
Public Enum SaveChangesOptions
繼承
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.

適用於

另請參閱