Export (0) Print
Expand All

ObjectContext.SaveChanges Method (Boolean)

Note: This API is now obsolete. The non-obsolete alternative is SaveChanges.

Persists all updates to the data source and optionally resets change tracking in the object context.

Namespace:  System.Data.Objects
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

[BrowsableAttribute(false)]
[ObsoleteAttribute("Use SaveChanges(SaveOptions options) instead.")]
public int SaveChanges(
	bool acceptChangesDuringSave
)

Parameters

acceptChangesDuringSave
Type: System.Boolean

This parameter is needed for client-side transaction support. If true, the change tracking on all objects is reset after SaveChanges(Boolean) finishes. If false, you must call the AcceptAllChanges method after SaveChanges(Boolean).

Return Value

Type: System.Int32
The number of objects in an Added, Modified, or Deleted state when SaveChanges was called.

ExceptionCondition
OptimisticConcurrencyException

An optimistic concurrency violation has occurred.

Call the SaveChanges(SaveOptions) method instead.

.NET Framework

Supported in: 3.5 SP1
Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.5
Obsolete (compiler warning) in 4.5.1
Obsolete (compiler warning) in 4.5.2
Obsolete (compiler warning) in 4

.NET Framework Client Profile

Obsolete (compiler warning) in 4
Show:
© 2015 Microsoft