Unosquare
    Show / Hide Table of Contents

    Class WebServerExtensions

    Provides extension methods for types implementing IWebServer.

    Inheritance
    Object
    WebServerExtensions
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: EmbedIO
    Syntax
    public static class WebServerExtensions

    Methods

    HandleHttpException<TWebServer>(TWebServer, HttpExceptionHandlerCallback)

    Sets the HTTP exception handler on an IWebServer.

    Declaration
    public static TWebServer HandleHttpException<TWebServer>(this TWebServer this, HttpExceptionHandlerCallback handler)
        where TWebServer : IWebServer
    Parameters
    Type Name Description
    TWebServer this

    The TWebServer on which this method is called.

    HttpExceptionHandlerCallback handler

    The HTTP exception handler.

    Returns
    Type Description
    TWebServer

    this with the OnHttpException property set to handler.

    Type Parameters
    Name Description
    TWebServer

    The type of the web server.

    See Also
    OnHttpException
    HttpExceptionHandler

    HandleUnhandledException<TWebServer>(TWebServer, ExceptionHandlerCallback)

    Sets the unhandled exception handler on an IWebServer.

    Declaration
    public static TWebServer HandleUnhandledException<TWebServer>(this TWebServer this, ExceptionHandlerCallback handler)
        where TWebServer : IWebServer
    Parameters
    Type Name Description
    TWebServer this

    The TWebServer on which this method is called.

    ExceptionHandlerCallback handler

    The unhandled exception handler.

    Returns
    Type Description
    TWebServer

    this with the OnUnhandledException property set to handler.

    Type Parameters
    Name Description
    TWebServer

    The type of the web server.

    See Also
    OnUnhandledException
    ExceptionHandler

    Start(IWebServer, CancellationToken)

    Starts a web server by calling RunAsync(CancellationToken) in another thread.

    Declaration
    public static void Start(this IWebServer this, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    IWebServer this

    The IWebServer on which this method is called.

    CancellationToken cancellationToken

    A used to stop the web server.

    WithLocalSessionManager<TWebServer>(TWebServer, Nullable<Action<LocalSessionManager>>)

    Creates a with all properties set to their default values and sets it as session manager on an IWebServer.

    Declaration
    public static TWebServer WithLocalSessionManager<TWebServer>(this TWebServer this, Action<LocalSessionManager>? configure = default(Action<LocalSessionManager>? ))
        where TWebServer : IWebServer
    Parameters
    Type Name Description
    TWebServer this

    The IWebServer on which this method is called.

    Nullable<Action<LocalSessionManager>> configure

    A callback used to configure the session manager.

    Returns
    Type Description
    TWebServer

    this with the session manager set.

    Type Parameters
    Name Description
    TWebServer

    The type of the web server.

    WithSessionManager<TWebServer>(TWebServer, ISessionManager)

    Sets the session manager on an IWebServer.

    Declaration
    public static TWebServer WithSessionManager<TWebServer>(this TWebServer this, ISessionManager sessionManager)
        where TWebServer : IWebServer
    Parameters
    Type Name Description
    TWebServer this

    The IWebServer on which this method is called.

    ISessionManager sessionManager

    The session manager.

    Returns
    Type Description
    TWebServer

    this with the session manager set.

    Type Parameters
    Name Description
    TWebServer

    The type of the web server.

    Comments

    Back to top Copyright © 2017-2019 Unosquare