コード例 #1
0
        /// <inheritdoc/>
        protected override void OnResultExecuted(ResultExecutedContext filterContext)
        {
            base.OnResultExecuted(filterContext);

            if (DynamicData != null)
            {
                DynamicData.Dispose();
                DynamicData = null;
            }

            /*
             * if (!ViewData.ModelState.IsValid)
             * {
             *  //workaround asp.net modelstate bug
             *  foreach (var key in ViewData.ModelState.Keys)
             *  {
             *      if (ViewData.ModelState[key].Errors != null)
             *      {
             *          for (int i = ViewData.ModelState[key].Errors.Count - 1; i > 0;i-- ; )
             *          {
             *              var error = ViewData.ModelState[key].Errors[i];
             *              if (String.IsNullOrEmpty(error.ErrorMessage) && error.Exception != null)
             *              {
             *                  error.ErrorMessage = error.Exception.Message;
             *              }
             *          }
             *      }
             *  }
             * }*/
        }
コード例 #2
0
        /// <inheritdoc/>
        protected override void OnResultExecuted(ResultExecutedContext filterContext)
        {
            base.OnResultExecuted(filterContext);

            if (DynamicData != null)
            {
                DynamicData.Dispose();
                DynamicData = null;
            }
        }