Unosquare
    Show / Hide Table of Contents

    Class RoutingModule

    A module that handles requests by resolving route / method pairs associated with handlers.

    Inheritance
    Object
    WebModuleBase
    RoutingModuleBase
    RoutingModule
    Implements
    IWebModuleImpl
    IWebModule
    Inherited Members
    RoutingModuleBase.IsFinalHandler
    RoutingModuleBase.OnRequestAsync(IHttpContext)
    RoutingModuleBase.AddHandler(HttpVerb, RouteMatcher, RouteHandlerCallback)
    RoutingModuleBase.AddHandler(HttpVerb, RouteMatcher, SyncRouteHandlerCallback)
    RoutingModuleBase.AddHandlersFrom(Object)
    RoutingModuleBase.OnAny(RouteMatcher, RouteHandlerCallback)
    RoutingModuleBase.OnAny(RouteMatcher, SyncRouteHandlerCallback)
    RoutingModuleBase.OnDelete(RouteMatcher, RouteHandlerCallback)
    RoutingModuleBase.OnDelete(RouteMatcher, SyncRouteHandlerCallback)
    RoutingModuleBase.OnGet(RouteMatcher, RouteHandlerCallback)
    RoutingModuleBase.OnGet(RouteMatcher, SyncRouteHandlerCallback)
    RoutingModuleBase.OnHead(RouteMatcher, RouteHandlerCallback)
    RoutingModuleBase.OnHead(RouteMatcher, SyncRouteHandlerCallback)
    RoutingModuleBase.OnOptions(RouteMatcher, RouteHandlerCallback)
    RoutingModuleBase.OnOptions(RouteMatcher, SyncRouteHandlerCallback)
    RoutingModuleBase.OnPatch(RouteMatcher, RouteHandlerCallback)
    RoutingModuleBase.OnPatch(RouteMatcher, SyncRouteHandlerCallback)
    RoutingModuleBase.OnPost(RouteMatcher, RouteHandlerCallback)
    RoutingModuleBase.OnPost(RouteMatcher, SyncRouteHandlerCallback)
    RoutingModuleBase.OnPut(RouteMatcher, RouteHandlerCallback)
    RoutingModuleBase.OnPut(RouteMatcher, SyncRouteHandlerCallback)
    RoutingModuleBase.OnPathNotFoundAsync(IHttpContext)
    RoutingModuleBase.OnMethodNotAllowedAsync(IHttpContext)
    WebModuleBase.Container
    WebModuleBase.IWebModuleImpl.SetContainer(IWebModuleContainer)
    WebModuleBase.BaseRoute
    WebModuleBase.OnUnhandledException
    WebModuleBase.OnHttpException
    WebModuleBase.LogSource
    WebModuleBase.Start(CancellationToken)
    WebModuleBase.MatchUrlPath(String)
    WebModuleBase.HandleRequestAsync(IHttpContext)
    WebModuleBase.OnStart(CancellationToken)
    WebModuleBase.SetContainer(IWebModuleContainer)
    Namespace: EmbedIO.Routing
    Syntax
    public class RoutingModule : RoutingModuleBase, IWebModuleImpl, IWebModule

    Constructors

    RoutingModule(String)

    Initializes a new instance of the RoutingModule class.

    Declaration
    public RoutingModule(string baseRoute)
    Parameters
    Type Name Description
    String baseRoute

    The base route served by this module.

    See Also
    BaseRoute

    Methods

    Add(HttpVerb, RouteMatcher, RouteHandlerCallback)

    Associates a HTTP method and a route to a handler.

    Declaration
    public void Add(HttpVerb verb, RouteMatcher matcher, RouteHandlerCallback handler)
    Parameters
    Type Name Description
    HttpVerb verb

    A HttpVerb constant representing the HTTP method to associate with handler, or Any if handler can handle all HTTP methods.

    RouteMatcher matcher

    The RouteMatcher used to match URL paths.

    RouteHandlerCallback handler

    A callback used to handle matching contexts.

    Add(HttpVerb, RouteMatcher, SyncRouteHandlerCallback)

    Associates a HTTP method and a route to a synchronous handler.

    Declaration
    public void Add(HttpVerb verb, RouteMatcher matcher, SyncRouteHandlerCallback handler)
    Parameters
    Type Name Description
    HttpVerb verb

    A HttpVerb constant representing the HTTP method to associate with handler, or Any if handler can handle all HTTP methods.

    RouteMatcher matcher

    The RouteMatcher used to match URL paths.

    SyncRouteHandlerCallback handler

    A callback used to handle matching contexts.

    AddFrom(Object)

    Adds handlers, associating them with HTTP method / route pairs by means of RouteAttribute attributes.

    See AddFrom(Object) for further information.

    Declaration
    public int AddFrom(object target)
    Parameters
    Type Name Description
    Object target

    Where to look for compatible handlers.

    Returns
    Type Description
    Int32

    The number of handlers that were added.

    Implements

    IWebModuleImpl
    IWebModule

    See Also

    WebModuleBase

    Comments

    Back to top Copyright © 2017-2019 Unosquare