Castle.ActiveRecord.HookDispatcher.OnFlushDirty C# (CSharp) Méthode

OnFlushDirty() public méthode

Called when an object is detected to be dirty, during a flush.
The interceptor may modify the detected currentState, which will be propagated to both the database and the persistent object. Note that all flushes end in an actual synchronization with the database, in which as the new currentState will be propagated to the object, but not necessarily (immediately) to the database. It is strongly recommended that the interceptor not modify the previousState.
public OnFlushDirty ( object entity, object id, object currentState, object previousState, string propertyNames, IType types ) : bool
entity object
id object
currentState object
previousState object
propertyNames string
types IType
Résultat bool
        public override bool OnFlushDirty(object entity, object id, object[] currentState, object[] previousState, string[] propertyNames, IType[] types)
        {
            ActiveRecordHooksBase hookTarget = entity as ActiveRecordHooksBase;

            if (hookTarget != null)
            {
                return hookTarget.OnFlushDirty(id, new DictionaryAdapter(propertyNames, previousState), new DictionaryAdapter(propertyNames, currentState), types);
            }

            return false;
        }