26.351. Class ServiceCollectionExt

Namespace: ArmoniK.Core.Utils
Assembly: ArmoniK.Core.Utils.dll

Extends the functionality of the

public static class ServiceCollectionExt

26.351.1. Inheritance

objectServiceCollectionExt

26.351.2. Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

26.351.3. Methods

26.351.3.1. AddInitializedOption<T>(IServiceCollection, IConfiguration, string)

Fill a class with values found in configurations

[PublicAPI]
public static IServiceCollection AddInitializedOption<T>(this IServiceCollection services, IConfiguration configuration, string key) where T : class, new()

26.351.3.1.1. Parameters

services IServiceCollection

Collection of services

configuration IConfiguration

Configurations used to populate the class

key string

Path to the Object in the configuration

26.351.3.1.2. Returns

IServiceCollection

Input collection of services to chain usages

26.351.3.1.3. Type Parameters

T

Class to fill

26.351.3.2. AddInitializedOption<T>(IServiceCollection, IConfiguration, string, out T)

Fills in an option class, add it in the service collection and return the initialized class

[PublicAPI]
public static IServiceCollection AddInitializedOption<T>(this IServiceCollection services, IConfiguration configuration, string key, out T option) where T : class, new()

26.351.3.2.1. Parameters

services IServiceCollection

Collection of service descriptors

configuration IConfiguration

Collection of configuration used to configure the option class

key string

Key to find the option to fill

option T

Represents the filled option class

26.351.3.2.2. Returns

IServiceCollection

The updated collection of service descriptors

26.351.3.2.3. Type Parameters

T

Type of option class to add

26.351.3.3. AddSingletonWithHealthCheck<T>(IServiceCollection, string)

Add a singleton service of the specified type with health check capabilities

[PublicAPI]
public static IServiceCollection AddSingletonWithHealthCheck<T>(this IServiceCollection services, string checkName) where T : class, IHealthCheckProvider

26.351.3.3.1. Parameters

services IServiceCollection

Collection of service descriptors

checkName string

Name for the health check

26.351.3.3.2. Returns

IServiceCollection

The updated collection of service descriptors

26.351.3.3.3. Type Parameters

T

Type of the service (interface)

26.351.3.4. AddSingletonWithHealthCheck<TService, TImplementation>(IServiceCollection, string)

Add a singleton service of the specified type with health check capabilities

[PublicAPI]
public static IServiceCollection AddSingletonWithHealthCheck<TService, TImplementation>(this IServiceCollection services, string checkName) where TService : class, IHealthCheckProvider where TImplementation : class, TService

26.351.3.4.1. Parameters

services IServiceCollection

Collection of service descriptors

checkName string

Name for the health check

26.351.3.4.2. Returns

IServiceCollection

The updated collection of service descriptors

26.351.3.4.3. Type Parameters

TService

Type of the service (interface)

TImplementation

Implementation class of the service

26.351.3.5. AddSingletonWithHealthCheck<TService>(IServiceCollection, string, TService)

Add a singleton service of the specified type with health check capabilities

[PublicAPI]
public static IServiceCollection AddSingletonWithHealthCheck<TService>(this IServiceCollection services, string checkName, TService implementationInstance) where TService : class, IHealthCheckProvider

26.351.3.5.1. Parameters

services IServiceCollection

Collection of service descriptors

checkName string

Name for the health check

implementationInstance TService

The instance of the service

26.351.3.5.2. Returns

IServiceCollection

The updated collection of service descriptors

26.351.3.5.3. Type Parameters

TService

Type of the service (interface)

26.351.3.6. AddSingletonWithHealthCheck<TService>(IServiceCollection, string, Func<IServiceProvider, TService>)

Add a singleton service of the specified type with health check capabilities

[PublicAPI]
public static IServiceCollection AddSingletonWithHealthCheck<TService>(this IServiceCollection services, string checkName, Func<IServiceProvider, TService> implementationFactory) where TService : class, IHealthCheckProvider

26.351.3.6.1. Parameters

services IServiceCollection

Collection of service descriptors

checkName string

Name for the health check

implementationFactory Func<IServiceProvider, TService>

The factory that creates the service

26.351.3.6.2. Returns

IServiceCollection

The updated collection of service descriptors

26.351.3.6.3. Type Parameters

TService

Type of the service (interface)

26.351.3.7. AddTransientWithHealthCheck<T>(IServiceCollection, string)

Add a transient service of the specified type with health check capabilities

[PublicAPI]
public static IServiceCollection AddTransientWithHealthCheck<T>(this IServiceCollection services, string checkName) where T : class, IHealthCheckProvider

26.351.3.7.1. Parameters

services IServiceCollection

Collection of service descriptors

checkName string

Name for the health check

26.351.3.7.2. Returns

IServiceCollection

The updated collection of service descriptors

26.351.3.7.3. Type Parameters

T

Type of the service (interface)

26.351.3.8. AddTransientWithHealthCheck<TService, TImplementation>(IServiceCollection, string)

Add a transient service of the specified type with health check capabilities

[PublicAPI]
public static IServiceCollection AddTransientWithHealthCheck<TService, TImplementation>(this IServiceCollection services, string checkName) where TService : class, IHealthCheckProvider where TImplementation : class, TService

26.351.3.8.1. Parameters

services IServiceCollection

Collection of service descriptors

checkName string

Name for the health check

26.351.3.8.2. Returns

IServiceCollection

The updated collection of service descriptors

26.351.3.8.3. Type Parameters

TService

Type of the service (interface)

TImplementation

Implementation class of the service

26.351.3.9. AddTransientWithHealthCheck<TService>(IServiceCollection, Func<IServiceProvider, TService>, string)

Add a transient service of the specified type with health check capabilities

[PublicAPI]
public static IServiceCollection AddTransientWithHealthCheck<TService>(this IServiceCollection services, Func<IServiceProvider, TService> implementationFactory, string checkName) where TService : class, IHealthCheckProvider

26.351.3.9.1. Parameters

services IServiceCollection

Collection of service descriptors

implementationFactory Func<IServiceProvider, TService>

Factory to create service

checkName string

Name for the health check

26.351.3.9.2. Returns

IServiceCollection

The updated collection of service descriptors

26.351.3.9.3. Type Parameters

TService

Type of the service