Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
覆盖 OnActionExecuting 以在客户端发送的参数类型与所需的操作参数类型之间进行匹配时,是否可以获得操作参数签名?
是的,首先使用 filterContext.ActionParameters.ContainsKey("myParameter") 按名称检查,然后尝试使用“as”关键字来查看它是否与类型匹配。