Unosquare
    Show / Hide Table of Contents

    Interface IWebModule

    Represents a module.

    Namespace: EmbedIO
    Syntax
    public interface IWebModule

    Properties

    BaseRoute

    Gets the base route of a module.

    Declaration
    string BaseRoute { get; }
    Property Value
    Type Description
    String

    The base route.

    Remarks

    A base route is either "/" (the root path), or a prefix starting and ending with a '/' character.

    Container

    Gets the container of this module.

    Declaration
    IWebModuleContainer Container { get; }
    Property Value
    Type Description
    IWebModuleContainer
    See Also
    IWebModuleContainer

    IsFinalHandler

    Gets a value indicating whether processing of a request should stop after a module has handled it.

    Declaration
    bool IsFinalHandler { get; }
    Property Value
    Type Description
    Boolean
    Remarks

    If this property is true, a HTTP context's SetHandled() method will be automatically called immediately after after the returned by HandleRequestAsync(IHttpContext) is completed. This will prevent the context from being passed further along to other modules.

    See Also
    IsHandled
    SetHandled()

    OnHttpException

    Gets or sets a callback that is called every time a HTTP exception is thrown during the processing of a request.

    If this property is null (the default), the exception will be handled by the web server, or by the containing ModuleGroup.

    Declaration
    HttpExceptionHandlerCallback OnHttpException { get; set; }
    Property Value
    Type Description
    HttpExceptionHandlerCallback
    See Also
    HttpExceptionHandler

    OnUnhandledException

    Gets or sets a callback that is called every time an unhandled exception occurs during the processing of a request.

    If this property is null (the default), the exception will be handled by the web server, or by the containing ModuleGroup.

    Declaration
    ExceptionHandlerCallback OnUnhandledException { get; set; }
    Property Value
    Type Description
    ExceptionHandlerCallback
    See Also
    ExceptionHandler

    Methods

    HandleRequestAsync(IHttpContext)

    Handles a request from a client.

    Declaration
    Task HandleRequestAsync(IHttpContext context)
    Parameters
    Type Name Description
    IHttpContext context

    The context of the request being handled.

    Returns
    Type Description
    Task

    A representing the ongoing operation.

    MatchUrlPath(String)

    Matches the specified URL path against a module's BaseRoute, extracting values for the route's parameters and a sub-path.

    Declaration
    RouteMatch MatchUrlPath(string path)
    Parameters
    Type Name Description
    String path

    The URL path to match.

    Returns
    Type Description
    RouteMatch

    If the match is successful, a object; otherwise, null.

    Start(CancellationToken)

    Signals a module that the web server is starting.

    Declaration
    void Start(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    A used to stop the web server.

    Comments

    Back to top Copyright © 2017-2019 Unosquare