Occurs before a new object is persisted to the data source.
Assembly: System.Web.Entity (in System.Web.Entity.dll)
The event is raised before a new object is persisted to the data source. The event enables you to modify or verify the object being added, add a different object, or cancel the operation. You can access the object to be added from the Entity property of the EntityDataSourceChangingEventArgs object. If supplying a different object, the user is responsible for setting the correct entity type in the Entity property.
When you handle the exception in the event handler, set the ExceptionHandled property to true. This prevents the exception from being raised again. When you specify a value of false for the ExceptionHandled property, the EntityDataSource re-raises the exception.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.