1
我有一個控制器:如何獲取ActionFilter中參數的所有屬性?
public class CatController
{
public something DoStuff([FromBody]string bibble)
{
}
}
我要創建通過每個參數一個ActionFilter和循環,看看有什麼屬性,該參數有,如[FromBody。我怎樣才能做到這一點?
public class InspectParametersActionFilter : ActionFilterAttribute, IActionFilter
{
public override void OnActionExecuting(HttpActionContext actionContext)
{
actionContext.ActionDescriptor.?
actionContext.ActionArguments.?
}
}