Esempio n. 1
0
        /// <summary>
        /// Method executed before real method execution. If ReturnValue is set, the real method body is not executed.
        /// </summary>
        /// <param name="method"></param>
        public override sealed void MethodEnter(Simple.MethodContext method)
        {
            string key = GetKey(method);

            method["Cache.Key"] = key;
            method.ReturnValue  = this.GetObject(method, key);
            method["Cache.Hit"] = method.ReturnValue != null;
        }
 /// <summary>
 /// Method executed before real method execution. If ReturnValue is set, the real method body is not executed.
 /// </summary>
 /// <param name="method"></param>
 public override sealed void MethodEnter(Simple.MethodContext method)
 {
     method.SetValue("sw", Stopwatch.StartNew());
 }