Export (0) Print
Expand All

ObjectContext.SaveChanges Method (Boolean)

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

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

.NET Framework Client Profile

Obsolete (compiler warning) in 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft