Exemple #1
0
        public void OnResultExecuting(ResultExecutingContext context)
        {
            var methodInfo          = context.ActionDescriptor.GetMethodInfo();
            var wrapResultAttribute =
                ReflectionHelper.GetSingleAttributeOfMemberOrDeclaringTypeOrDefault <WrapResultAttribute>(
                    methodInfo,
                    WrapResultAttribute.Default
                    );

            if (!wrapResultAttribute.WrapOnSuccess)
            {
                return;
            }

            AbpActionResultWrapperFactory
            .CreateFor(context.Result)
            .Wrap(context.Result);
        }
        public virtual void OnResultExecuting(ResultExecutingContext context)
        {
            if (this._configuration.SetNoCacheForAjaxResponses && context.HttpContext.Request.IsAjaxRequest())
            {
                this.SetNoCache(context);
            }

            var methodInfo          = context.ActionDescriptor.GetMethodInfo();
            var wrapResultAttribute =
                ReflectionHelper.GetSingleAttributeOfMemberOrDeclaringTypeOrDefault(
                    methodInfo,
                    this._configuration.DefaultWrapResultAttribute
                    );

            if (!wrapResultAttribute.WrapOnSuccess)
            {
                return;
            }

            AbpActionResultWrapperFactory
            .CreateFor(context)
            .Wrap(context);
        }