Class QueryParsingConfig

Configures how query-binding middleware parses query strings.

Inheritance
object
QueryParsingConfig
Implements
IEquatable<QueryParsingConfig>
Inherited Members
object.GetType()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: NanoRoute
Assembly: NanoRoute.dll
Syntax
public sealed record QueryParsingConfig : IEquatable<QueryParsingConfig>
Remarks

Query-binding middleware snapshots the configuration that is current when it is registered.

Examples
builder.ConfigureQueryParsing(config => config with
{
    UnexpectedParameterBehavior = UnexpectedParameterBehavior.Reject
});

Constructors

QueryParsingConfig()

Declaration
public QueryParsingConfig()

Properties

Default

Gets the default query-parsing configuration.

Declaration
public static QueryParsingConfig Default { get; }
Property Value
Type Description
QueryParsingConfig
Examples
QueryParsingConfig config = QueryParsingConfig.Default;

UnexpectedParameterBehavior

Gets how undeclared query-string parameters are handled.

Declaration
public UnexpectedParameterBehavior UnexpectedParameterBehavior { get; init; }
Property Value
Type Description
UnexpectedParameterBehavior
Remarks

The default is Ignore, so additional query-string keys that are not present in the binding descriptor do not affect request processing.

Examples
builder.ConfigureQueryParsing(config => config with
{
    UnexpectedParameterBehavior = UnexpectedParameterBehavior.Reject
});
Exceptions
Type Condition
ArgumentOutOfRangeException

Thrown when the assigned value is not a defined UnexpectedParameterBehavior value.

Implements

IEquatable<T>
In this article
Back to top Generated by DocFX