Class NanoRouteQueryExtensions

Adds query-parameter binding helpers to NanoRoute.

Inheritance
object
NanoRouteQueryExtensions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: NanoRoute
Assembly: NanoRoute.dll
Syntax
public static class NanoRouteQueryExtensions

Methods

AddQueryBindings<TBuilder>(TBuilder, IEnumerable<string>, string)

Parses configured query parameters and stores their values in Parameters.

Declaration
public static TBuilder AddQueryBindings<TBuilder>(this TBuilder routeBuilder, IEnumerable<string> verbs, string bindings) where TBuilder : notnull, RouteBuilder
Parameters
Type Name Description
TBuilder routeBuilder
IEnumerable<string> verbs

The HTTP methods that activate the query-binding middleware.

string bindings

A query-parameter descriptor such as {filter:str(min=3)}&{page?:int(min=1)}.

Returns
Type Description
TBuilder

The current routeBuilder instance.

Type Parameters
Name Description
TBuilder
Remarks

Parsed query values are written into Parameters. If that dictionary already contains the same key because of route binding, JSON binding, or earlier middleware, the query binding overwrites the existing value.

AddQueryBindings<TBuilder>(TBuilder, IEnumerable<string>, string, string)

Parses configured query parameters and stores their values in Parameters.

Declaration
public static TBuilder AddQueryBindings<TBuilder>(this TBuilder routeBuilder, IEnumerable<string> verbs, string pattern, string bindings) where TBuilder : notnull, RouteBuilder
Parameters
Type Name Description
TBuilder routeBuilder
IEnumerable<string> verbs

The HTTP methods that activate the query-binding middleware.

string pattern

The route pattern where the query-binding middleware should be inserted. Use / to apply it to the whole pipeline, or a narrower prefix/exact pattern to scope query binding to selected routes.

string bindings

A query-parameter descriptor such as {filter:str(min=3)}&{page?:int(min=1)}.

Returns
Type Description
TBuilder

The current routeBuilder instance.

Type Parameters
Name Description
TBuilder
Remarks

Parsed query values are written into Parameters. If that dictionary already contains the same key because of route binding, JSON binding, or earlier middleware, the query binding overwrites the existing value.

AddQueryBindings<TBuilder>(TBuilder, string)

Parses configured query parameters and stores their values in Parameters.

Declaration
public static TBuilder AddQueryBindings<TBuilder>(this TBuilder routeBuilder, string bindings) where TBuilder : notnull, RouteBuilder
Parameters
Type Name Description
TBuilder routeBuilder
string bindings

A query-parameter descriptor such as {filter:str(min=3)}&{page?:int(min=1)}.

Returns
Type Description
TBuilder

The current routeBuilder instance.

Type Parameters
Name Description
TBuilder
Remarks

Parsed query values are written into Parameters. If that dictionary already contains the same key because of route binding, JSON binding, or earlier middleware, the query binding overwrites the existing value.

AddQueryBindings<TBuilder>(TBuilder, string, string)

Parses configured query parameters and stores their values in Parameters.

Declaration
public static TBuilder AddQueryBindings<TBuilder>(this TBuilder routeBuilder, string pattern, string bindings) where TBuilder : notnull, RouteBuilder
Parameters
Type Name Description
TBuilder routeBuilder
string pattern

The route pattern where the query-binding middleware should be inserted. Use / to apply it to the whole pipeline, or a narrower prefix/exact pattern to scope query binding to selected routes.

string bindings

A query-parameter descriptor such as {filter:str(min=3)}&{page?:int(min=1)}.

Returns
Type Description
TBuilder

The current routeBuilder instance.

Type Parameters
Name Description
TBuilder
Remarks

Parsed query values are written into Parameters. If that dictionary already contains the same key because of route binding, JSON binding, or earlier middleware, the query binding overwrites the existing value.

AddQueryBindings<TBuilder>(TBuilder, string, string, string)

Parses configured query parameters and stores their values in Parameters.

Declaration
public static TBuilder AddQueryBindings<TBuilder>(this TBuilder routeBuilder, string verb, string pattern, string bindings) where TBuilder : notnull, RouteBuilder
Parameters
Type Name Description
TBuilder routeBuilder
string verb

The HTTP method that activates the query-binding middleware.

string pattern

The route pattern where the query-binding middleware should be inserted. Use / to apply it to the whole pipeline, or a narrower prefix/exact pattern to scope query binding to selected routes.

string bindings

A query-parameter descriptor such as {filter:str(min=3)}&{page?:int(min=1)}.

Returns
Type Description
TBuilder

The current routeBuilder instance.

Type Parameters
Name Description
TBuilder
Remarks

Parsed query values are written into Parameters. If that dictionary already contains the same key because of route binding, JSON binding, or earlier middleware, the query binding overwrites the existing value.

In this article
Back to top Generated by DocFX