21.351. Class ServiceCollectionExt
Namespace: ArmoniK.Core.Utils
Assembly: ArmoniK.Core.Utils.dll
Extends the functionality of the
public static class ServiceCollectionExt
21.351.1. Inheritance
21.351.2. Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
21.351.3. Methods
21.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()
21.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
21.351.3.1.2. Returns
Input collection of services to chain usages
21.351.3.1.3. Type Parameters
T
Class to fill
21.351.3.2. AddOption<T>(IServiceCollection, IConfiguration, string)
Fills in an option class and add it to the service collection
[PublicAPI]
public static IServiceCollection AddOption<T>(this IServiceCollection services, IConfiguration configuration, string key) where T : class
21.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
21.351.3.2.2. Returns
The updated collection of service descriptors
21.351.3.2.3. Type Parameters
T
Type of option class to add
21.351.3.3. AddOption<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 AddOption<T>(this IServiceCollection services, IConfiguration configuration, string key, out T option) where T : class
21.351.3.3.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
21.351.3.3.2. Returns
The updated collection of service descriptors
21.351.3.3.3. Type Parameters
T
Type of option class to add
21.351.3.4. 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
21.351.3.4.1. Parameters
services IServiceCollection
Collection of service descriptors
checkName string
Name for the health check
21.351.3.4.2. Returns
The updated collection of service descriptors
21.351.3.4.3. Type Parameters
T
Type of the service (interface)
21.351.3.5. 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
21.351.3.5.1. Parameters
services IServiceCollection
Collection of service descriptors
checkName string
Name for the health check
21.351.3.5.2. Returns
The updated collection of service descriptors
21.351.3.5.3. Type Parameters
TService
Type of the service (interface)
TImplementation
Implementation class of the service
21.351.3.6. 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
21.351.3.6.1. Parameters
services IServiceCollection
Collection of service descriptors
checkName string
Name for the health check
implementationInstance TService
The instance of the service
21.351.3.6.2. Returns
The updated collection of service descriptors
21.351.3.6.3. Type Parameters
TService
Type of the service (interface)
21.351.3.7. 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
21.351.3.7.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
21.351.3.7.2. Returns
The updated collection of service descriptors
21.351.3.7.3. Type Parameters
TService
Type of the service (interface)
21.351.3.8. 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
21.351.3.8.1. Parameters
services IServiceCollection
Collection of service descriptors
checkName string
Name for the health check
21.351.3.8.2. Returns
The updated collection of service descriptors
21.351.3.8.3. Type Parameters
T
Type of the service (interface)
21.351.3.9. 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
21.351.3.9.1. Parameters
services IServiceCollection
Collection of service descriptors
checkName string
Name for the health check
21.351.3.9.2. Returns
The updated collection of service descriptors
21.351.3.9.3. Type Parameters
TService
Type of the service (interface)
TImplementation
Implementation class of the service
21.351.3.10. 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
21.351.3.10.1. Parameters
services IServiceCollection
Collection of service descriptors
implementationFactory Func<IServiceProvider, TService>
Factory to create service
checkName string
Name for the health check
21.351.3.10.2. Returns
The updated collection of service descriptors
21.351.3.10.3. Type Parameters
TService
Type of the service