This documentation is archived and is not being maintained.

IEntityChangeTracker Interface

Defines the facilities that are used by Object Services to track changes that are made to the properties of an object.

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

public interface IEntityChangeTracker

EntityObject and ComplexObject are the base classes for entity types and complex types generated by the Entity Data Model tools. Both base classes use IEntityChangeTracker to report property changes.

When tracking changes that are made to custom data classes, you must use IEntityChangeTracker to report property changes. For more information, see Reporting Changes in Custom Data Classes (Entity Framework).

The following example shows how to set the instance of IEntityChangeTracker used by an object to track changes to scalar and complex properties.

IEntityChangeTracker _changeTracker = null;

// Specify the IEntityChangeTracker to use for tracking changes. 
void IEntityWithChangeTracker.SetChangeTracker(IEntityChangeTracker changeTracker)
    _changeTracker = changeTracker;

    // Every time the change tracker is set, we must also set all the  
    // complex type change trackers. 
    if (_extendedInfo != null)
        _extendedInfo.SetComplexChangeTracker("ExtendedInfo", _changeTracker);

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.

.NET Framework

Supported in: 3.5 SP1