KestrunHostMapExtensions.AddMapRoute method (1 of 6)

Adds a route to the KestrunHost using the specified MapRouteOptions.

public static KestrunHost AddMapRoute(this KestrunHost host, MapRouteOptions options)
parameter description
host The KestrunHost instance.
options The MapRouteOptions containing route configuration.

Return Value

The KestrunHost instance for chaining.

See Also


KestrunHostMapExtensions.AddMapRoute method (2 of 6)

Adds a native route to the KestrunHost using the specified MapRouteOptions and handler.

public static KestrunHost AddMapRoute(this KestrunHost host, MapRouteOptions options, 
    KestrunHandler handler, out IEndpointConventionBuilder? map)
parameter description
host The KestrunHost instance.
options The MapRouteOptions containing route configuration.
handler The handler to execute for the route.
map The endpoint convention builder for further configuration.

Return Value

The KestrunHost instance for chaining.

See Also


KestrunHostMapExtensions.AddMapRoute method (3 of 6)

Adds a native route to the KestrunHost for the specified pattern and HTTP verb.

public static KestrunHost AddMapRoute(this KestrunHost host, string pattern, HttpVerb httpVerb, 
    KestrunHandler handler, out IEndpointConventionBuilder? map, string[]? requireSchemes = null)
parameter description
host The KestrunHost instance.
pattern The route pattern.
httpVerb The HTTP verb for the route.
handler The handler to execute for the route.
requireSchemes Optional array of authorization schemes required for the route.
map The endpoint convention builder for further configuration.

Return Value

The KestrunHost instance for chaining.

See Also


KestrunHostMapExtensions.AddMapRoute method (4 of 6)

Adds a native route to the KestrunHost for the specified pattern and HTTP verbs.

public static KestrunHost AddMapRoute(this KestrunHost host, string pattern, 
    IEnumerable<HttpVerb> httpVerbs, KestrunHandler handler, out IEndpointConventionBuilder? map, 
    string[]? requireSchemes = null)
parameter description
host The KestrunHost instance.
pattern The route pattern.
httpVerbs The HTTP verbs for the route.
handler The handler to execute for the route.
requireSchemes Optional array of authorization schemes required for the route.
map The endpoint convention builder for further configuration.

Return Value

The KestrunHost instance for chaining.

See Also


KestrunHostMapExtensions.AddMapRoute method (5 of 6)

Adds a route to the KestrunHost that executes a script block for the specified HTTP verb and pattern.

public static KestrunHost AddMapRoute(this KestrunHost host, string pattern, HttpVerb httpVerbs, 
    string scriptBlock, ScriptLanguage language = ScriptLanguage.PowerShell, 
    string[]? requireSchemes = null, Dictionary<string, object?>? arguments = null)
parameter description
host The KestrunHost instance.
pattern The route pattern.
httpVerbs The HTTP verb for the route.
scriptBlock The script block to execute.
language The scripting language to use (default is PowerShell).
requireSchemes Optional array of authorization schemes required for the route.
arguments Optional dictionary of arguments to pass to the script.

Return Value

The KestrunHost instance for chaining.

See Also


KestrunHostMapExtensions.AddMapRoute method (6 of 6)

Adds a route to the KestrunHost that executes a script block for the specified HTTP verbs and pattern.

public static KestrunHost AddMapRoute(this KestrunHost host, string pattern, 
    IEnumerable<HttpVerb> httpVerbs, string scriptBlock, 
    ScriptLanguage language = ScriptLanguage.PowerShell, string[]? requireSchemes = null, 
    Dictionary<string, object?>? arguments = null)
parameter description
host The KestrunHost instance.
pattern The route pattern.
httpVerbs The HTTP verbs for the route.
scriptBlock The script block to execute.
language The scripting language to use (default is PowerShell).
requireSchemes Optional array of authorization schemes required for the route.
arguments Optional dictionary of arguments to pass to the script.

Return Value

The KestrunHost instance for chaining.

See Also