/// <summary>
/// Called when an object is detected to be dirty, during a flush.
/// </summary>
/// <param name="currentState"></param>
/// <param name="entity"></param>
/// <param name="id"></param>
/// <param name="previousState"></param>
/// <param name="propertyNames"></param>
/// <param name="types"></param>
/// <remarks>
/// The interceptor may modify the detected <c>currentState</c>, 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 <c>currentState</c> will be propagated
/// to the object, but not necessarily (immediately) to the database. It is strongly recommended
/// that the interceptor <b>not</b> modify the <c>previousState</c>.
/// </remarks>
/// <returns><c>true</c> if the user modified the <c>currentState</c> in any way</returns>
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);
}