Note to self - validation in action filters
In dotnet, if you want to do validation in ActionFilters, in order to access request parameters, you can use HttpActionContext methods as follows.
If your parameter is an object sent in the body, you can cast it from here too. Don't forget to check for nulls though.
var myParam = context.ActionArguments["paramName"];
If your parameter is an object sent in the body, you can cast it from here too. Don't forget to check for nulls though.
Comments
Post a Comment