c# - Custom Attribute for the route -
I want to create a custom attribute, for the parameters in my path I can not use the "parameterbugging attribute"
Before "do something", I want to verify the parameter myVar
how to do this? Get the public IHttpActionResult ([myAttribute] int myVAR) {// Something}
Thanks
You can write an action filter that will inspect value.
[VerifyMyVar] Public IHttpActionResult Get (Int myVar) {// TODO} Public Class VerifyMyVar: HttpActionFilterAttribute {...}
If you are more specific If you want verification, you can inspect MethodInfo from the filter, and do something special with [MyAttribute] code inside.
Comments
Post a Comment