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)

member SavingChanges : IEvent<EventHandler,
    EventArgs>

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 AdventureWorks 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
Available since 3.5
Return to top
Show: