Search Results for

    Show / Hide Table of Contents

    Class ServiceCollectionExtensions

    Dependency-injection registration.

    Inheritance
    object
    ServiceCollectionExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Activout.Blue5
    Assembly: Activout.Blue5.dll
    Syntax
    public static class ServiceCollectionExtensions
    Remarks

    These are C# 14 extension members on IServiceCollection. The API reference generator does not list extension blocks, so they are described here:

    • IHttpClientBuilder AddBlue5(this IServiceCollection services, Blue5Options options): registers Blue5Client with the given options.
    • IHttpClientBuilder AddBlue5(this IServiceCollection services, Func<IServiceProvider, Blue5Options> optionsFactory): registers Blue5Client with options resolved from the container, for example bound from configuration.

    Both register Blue5Client as a typed HttpClient client and return the IHttpClientBuilder, so you can chain your own handlers, or AddBlue5Resilience() from the Activout.Blue5.Resilience package.

    builder.Services
        .AddBlue5(builder.Configuration.GetSection("Blue5").Get<Blue5Options>()!)
        .AddBlue5Resilience();   // optional
    
    // then inject Blue5Client
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX