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 IServiceCollection

    IServiceCollectionExtensions

    public static class IServiceCollectionExtensions

    Inheritance
    object
    IServiceCollectionExtensions
    Examples
    Arguments
    X

    Methods

    Extension methods for IServiceCollection

    public static IServiceCollection AddFrameworkServices(this IServiceCollection serviceCollection, FrameworkOptions options = null)

    X
    Methods arguments
    Type Name Description
    IServiceCollection serviceCollection
    FrameworkOptions options
    X
    Type Description
    IServiceCollection

    Configures ServiceCollection in one-line, so register all of your own or other service configurations after this one

    Registers:

    - MVC services

    - Razor Page services

    - Routing services

    - ForwardedProtocol and ForwardedIp (XForwardedFor) headers

    - Compression for Gzip and Brotli services

    - Authentication and authorization services

    - Output cache services

    - Registers the main assembly and all its controllers (if any), as in: your Web Application Project's assembly

    Optionally, through the argument FrameworkOptions:

    - Can register view locations

    - Can register area view locations

    - Can register one ViewLocationExpander

    - and more...

    public static IServiceCollection AddFrameworkServices<TLogWriter>(this IServiceCollection serviceCollection, FrameworkOptions options = null) where TLogWriter : class, ILogWriter

    X

    Startup.cs/Program.cs:

    public void ConfigureServices(IServiceCollection services)
    {
        var options = new FrameworkOptions();
    
        options.ViewLocations = new string[] {
            "~/Views/{0}/index.cshtml"
        }
    
        options.AreaViewLocations = new string[] {
            "~/Area/{2}/{1}/{0}.cshtml"
        }
    
        options.ViewLocationExpander = null; //or create one based on the Interface 'IViewLocationExpander'
    
        options.UseDataProtectionPolicy = true; // Register and enabled the data protection policy in this framework
    
        services.AddFrameworkServices<TLogWriter>(options);
    }
    X
    Generic types
    Name Description
    TLogWriter
    Methods arguments
    Type Name Description
    IServiceCollection serviceCollection
    FrameworkOptions options
    X
    Type Description
    IServiceCollection

    Extension methods for IServiceCollection

    public static IServiceCollection UseDataProtectionPolicy(this IServiceCollection services, FrameworkOptions options)

    X
    Methods arguments
    Type Name Description
    IServiceCollection services
    FrameworkOptions options
    X
    Type Description
    IServiceCollection

    }

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