Asp.net Web API - return data from actionfilter

后端 未结 3 1189
猫巷女王i
猫巷女王i 2021-02-04 02:25

I want to return a json object from the wep api actionfilter. How can I achieve this?

I can return the object from action but I need to return some data from the actionf

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-04 03:21

    Just throwing this out there in case anyone else comes here like me and doesn't find an answer to their problem:

    You may be using the wrong import - You have 2 options:

    • System.Web.Http.Filters
    • System.Web.Mvc (or System.Web.Http.Mvc)

    Courtesy of Troy Dai from this question: Why is my ASP.NET Web API ActionFilterAttribute OnActionExecuting not firing?

提交回复
热议问题