BeforeSave() защищенный Метод

Hook to change the object state before saving it.
protected BeforeSave ( IDictionary state ) : bool
state IDictionary
Результат bool
Пример #1
0
        /// <summary>
        /// Called before an object is saved
        /// </summary>
        /// <param name="entity"></param>
        /// <param name="id"></param>
        /// <param name="propertyNames"></param>
        /// <param name="state"></param>
        /// <param name="types"></param>
        /// <remarks>
        /// The interceptor may modify the <c>state</c>, which will be used for the SQL <c>INSERT</c>
        /// and propagated to the persistent object
        /// </remarks>
        /// <returns><c>true</c> if the user modified the <c>state</c> in any way</returns>
        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);
        }