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

OnSave() public méthode

Called before an object is saved
The interceptor may modify the state, which will be used for the SQL INSERT and propagated to the persistent object
public OnSave ( object entity, object id, object state, string propertyNames, IType types ) : bool
entity object
id object
state object
propertyNames string
types IType
Résultat bool
        public override bool OnSave(object entity, object id, object[] state, string[] propertyNames, IType[] types)
        {
            ActiveRecordHooksBase hookTarget = entity as ActiveRecordHooksBase;

            if (hookTarget != null)
            {
                return hookTarget.BeforeSave(new DictionaryAdapter(propertyNames, state));
            }

            return false;
        }