//------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ using System; using System.Collections.Generic; using System.Text; using System.Data.Objects.DataClasses; namespace System.Data.Objects.Internal { /// /// A strategy interface that defines methods used for different types of change tracking. /// Implementors of this interface are used by the EntityWrapper class. /// internal interface IChangeTrackingStrategy { /// /// Sets a change tracker onto an entity, or does nothing if the entity does not support change trackers. /// /// The change tracker to set void SetChangeTracker(IEntityChangeTracker changeTracker); /// /// Takes a snapshot of the entity contained in the given state entry, or does nothing if /// snapshots are not required for the entity. /// /// The state entry representing the entity to snapshot void TakeSnapshot(EntityEntry entry); /// /// Sets the given value onto the entity with the registered change either handled by the /// entity itself or by using the given EntityEntry as the change tracker. /// /// The state entry of the entity to for which a value should be set /// State member information indicating the member to set /// The ordinal of the member to set /// The object onto which the value should be set; may be the entity, or a contained complex value /// The value to set void SetCurrentValue(EntityEntry entry, StateManagerMemberMetadata member, int ordinal, object target, object value); /// /// Updates the current value records using Shaper.UpdateRecord but with additional change tracking logic /// added as required by POCO and proxy entities. /// /// The value /// The existing ObjectStateEntry void UpdateCurrentValueRecord(object value, EntityEntry entry); } }