Export (0) Print
Expand All

ObjectContext::SavingChanges Event

Occurs when changes are saved to the data source.

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

public:
 event EventHandler^ SavingChanges {
	void add (EventHandler^ value);
	void remove (EventHandler^ value);
}

The SavingChanges event is raised at the start of a SaveChanges operation on an ObjectContext. This event is typically used to validate changed objects before new values are written to the database.

This example is based on the Adventure Works Sales Model. This registers a handler for the SavingChanges event that performs entity state validation.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5 SP1

.NET Framework Client Profile

Supported in: 4
Show:
© 2015 Microsoft