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.5.2
Obsolete (compiler warning) in 4.5.1
Obsolete (compiler warning) in 4.5
Obsolete (compiler warning) in 4

.NET Framework Client Profile

Obsolete (compiler warning) in 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft