System Library Common Framework
Search Results for

    *.Benchmark*,*.Tests*,*.ApiTests*,*.BaseTest*,DelegateJsonConverter,CalleeCancelledRequestException,ClientResponse,ContentType,OutputCachePolicy
    Show / Hide Table of Contents Show / Hide Table of Contents
    NamespaceSystemLibrary.Common.Framework.App.Extensions SystemLibrary.Common.Framework.App.dll

    Extension methods for ApplicationBuilder object

    IApplicationBuilderExtensions

    public static class IApplicationBuilderExtensions

    Inheritance
    object
    IApplicationBuilderExtensions
    Examples
    Arguments
    X

    Methods

    Register common middlewares for a web application

    This will register:

    - Http to Https redirection middleware, client and server side

    - Routing urls to controllers middleware

    - /api/ urls to controllers middleware

    - Authentication and Authorization attributes' middleware

    - Servince static files such as .css, .js, .jpg, etc... middleware

    - Forwarded headers middleware

    - Razor pages and Mvc middleware

    - Secure cookie policy middleware

    - Secure cookie policy (http only middleware

    - Recompiling razor pages (saving a cshtml file) middleware

    - Exception page middleware
    Remarks
    X

    This should be your first registration of middlewares you have, exception might be your own middleware for logging/tracing requests

    public static IApplicationBuilder UseFrameworkMiddlewares(this IApplicationBuilder app, IWebHostEnvironment env, FrameworkOptions options = null)

    X

    Startup.cs/Program.cs:

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        var options = new FrameworkOptions();
    
        app.UseFrameworkApp(options);
    }
    X
    Methods arguments
    Type Name Description
    IApplicationBuilder app
    IWebHostEnvironment env
    FrameworkOptions options
    X
    Type Description
    IApplicationBuilder

    }

    In This Article
    Package: nuget
    Source: github
    Website: System Library Common Framework