如何在OnActionExecuted动作过滤器Web API 2中传递模型对象?

时间:2018-11-29 08:29:16

标签: asp.net-web-api asp.net-web-api2 action-filter actionfilterattribute custom-action-filter

这是我的操作代码筛选属性“ Actions”类型为我的模型类型。

System.out.println("please enter day :");
    String a1 = input.nextLine();
    while (!dayArray.contains(a1)){
        System.out.println("invalid day , please enter another day : ");
        a1 = input.nextLine();
    }
    System.out.println("please enter time : ");
    String a2 = input.nextLine();
    while (!timeArray.contains(a2)){
        System.out.println("invalid time , please enter another time : ");
        a2 = input.nextLine();
    }

如果我通过像这样的模型public class LockProvisionPeriod : ActionFilterAttribute { public UserInfo Actions { get; set; } public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext) { var name = Actions; base.OnActionExecuted(actionExecutedContext); } } 其抛出[LockProvisionPeriod(Actions=UserInfo )]。 有什么方法可以在actionExecuted或actionExecuting过滤器中传递模型对象?

0 个答案:

没有答案