Class DisableQueryStringAttribute
- Namespace
- JsonApiDotNetCore.Controllers.Annotations
- Assembly
- JsonApiDotNetCore.dll
Used on an ASP.NET controller class to indicate which query string parameters are blocked.
[PublicAPI]
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct)]
public sealed class DisableQueryStringAttribute : Attribute
- Inheritance
-
DisableQueryStringAttribute
- Inherited Members
Examples
[DisableQueryString(JsonApiQueryStringParameters.Sort | JsonApiQueryStringParameters.Page)] public class CustomersController : JsonApiController<Customer> { }
[DisableQueryString("skipCache")] public class CustomersController : JsonApiController<Customer> { }
Constructors
DisableQueryStringAttribute(JsonApiQueryStringParameters)
Disables one or more of the builtin query parameters for a controller.
public DisableQueryStringAttribute(JsonApiQueryStringParameters parameters)
Parameters
parameters
JsonApiQueryStringParameters
DisableQueryStringAttribute(string)
It is allowed to use a comma-separated list of strings to indicate which query parameters should be disabled, because the user may have defined custom query parameters that are not included in the JsonApiQueryStringParameters enum.
public DisableQueryStringAttribute(string parameterNames)
Parameters
parameterNames
string
Fields
Empty
public static readonly DisableQueryStringAttribute Empty
Field Value
Properties
ParameterNames
public IReadOnlySet<string> ParameterNames { get; }
Property Value
Methods
ContainsParameter(JsonApiQueryStringParameters)
public bool ContainsParameter(JsonApiQueryStringParameters parameter)
Parameters
parameter
JsonApiQueryStringParameters