Base solution for your next web application

Activities of "jaq316"

For anyone that wants to do the same... Here is the solution:

  1. Create the filter class:
public class PlainTextResponseActionFilter : ActionFilterAttribute, IActionFilter, IFilter
    {

        public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
            var abpAjaxContent = actionExecutedContext.Response.Content as ObjectContent<Abp.Web.Models.AjaxResponse>;
            if (abpAjaxContent != null)
            {
                var previousValue = abpAjaxContent.Value as Abp.Web.Models.AjaxResponse;
                actionExecutedContext.ActionContext.Response.Content = new StringContent(previousValue.Result.ToString());
            }
            else
                base.OnActionExecuted(actionExecutedContext);
        }

    }
  1. Reference the class in the WithFilters method of the DynamicApicontrollerBuilder
DynamicApiControllerBuilder
                .For<ISomeAppService>("app/some")
                .ForMethod("Process")
                .WithVerb(Abp.Web.HttpVerb.Get)
                .WithFilters(new PlainTextResponseActionFilter())
                .Build();

40 views but no response?

Yes. I have.

Showing 1 to 3 of 3 entries