Class QueryStringValidationFilterAttribute
- Namespace
- Magicalizer.Api
- Assembly
- Magicalizer.dll
Adds the model state errors for the query parameters the action doesn't support (e.g. a misspelled filter condition) and for the invalid collection conditions (the list form with gaps in the indexes or combined with the single form), as the response would have the objects the client didn't ask for. The parameters of IgnoredQueryParameters are allowed anyway. It runs before ApiControllerAttribute rejects the requests with the model state errors, so the client gets all the errors of the request at once.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method)]
public class QueryStringValidationFilterAttribute : ActionFilterAttribute, IActionFilter, IAsyncActionFilter, IResultFilter, IAsyncResultFilter, IOrderedFilter, IFilterMetadata
- Inheritance
-
QueryStringValidationFilterAttribute
- Implements
- Inherited Members
Constructors
QueryStringValidationFilterAttribute()
Creates a filter. It runs before the filter of ApiControllerAttribute (-2000).
public QueryStringValidationFilterAttribute()
Methods
OnActionExecuting(ActionExecutingContext)
Called before the action executes, after model binding is complete.
public override void OnActionExecuting(ActionExecutingContext context)
Parameters
contextActionExecutingContext