View Source
Class ServiceCollectionExtensions
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
public static class ServiceCollectionExtensions
Methods
View Source
AddMultipleUnique<TService1, TService2, TImplementing>(IServiceCollection)
Adds services of types TService1
& TService2
with a shared
implementation type of TImplementing
to the specified .
Declaration
public static void AddMultipleUnique<TService1, TService2, TImplementing>(this IServiceCollection services)
where TService1 : class where TService2 : class where TImplementing : class, TService1, TService2
Parameters
Type |
Name |
Description |
IServiceCollection |
services |
|
Type Parameters
Name |
Description |
TService1 |
|
TService2 |
|
TImplementing |
|
View Source
AddMultipleUnique<TService1, TService2, TImplementing>(IServiceCollection, ServiceLifetime)
Adds services of types TService1
& TService2
with a shared implementation type of TImplementing
to the specified .
Declaration
public static void AddMultipleUnique<TService1, TService2, TImplementing>(this IServiceCollection services, ServiceLifetime lifetime)
where TService1 : class where TService2 : class where TImplementing : class, TService1, TService2
Parameters
Type |
Name |
Description |
IServiceCollection |
services |
|
ServiceLifetime |
lifetime |
|
Type Parameters
Name |
Description |
TService1 |
|
TService2 |
|
TImplementing |
|
View Source
AddUnique(IServiceCollection, Type, Object)
Adds a singleton service of the type specified by serviceType
to the specified
.
Declaration
public static void AddUnique(this IServiceCollection services, Type serviceType, object instance)
Parameters
Type |
Name |
Description |
IServiceCollection |
services |
|
Type |
serviceType |
|
System.Object |
instance |
|
View Source
AddUnique<TImplementing>(IServiceCollection)
Declaration
public static void AddUnique<TImplementing>(this IServiceCollection services)
where TImplementing : class
Parameters
Type |
Name |
Description |
IServiceCollection |
services |
|
Type Parameters
Name |
Description |
TImplementing |
|
View Source
AddUnique<TService>(IServiceCollection, TService)
Adds a singleton service of type TService
to the specified
.
Declaration
public static void AddUnique<TService>(this IServiceCollection services, TService instance)
where TService : class
Parameters
Type |
Name |
Description |
IServiceCollection |
services |
|
TService |
instance |
|
Type Parameters
Name |
Description |
TService |
|
View Source
AddUnique<TService>(IServiceCollection, Func<IServiceProvider, TService>)
Adds a service of type TService
with an implementation factory method to the specified
.
Declaration
public static void AddUnique<TService>(this IServiceCollection services, Func<IServiceProvider, TService> factory)
where TService : class
Parameters
Type |
Name |
Description |
IServiceCollection |
services |
|
Func<IServiceProvider, TService> |
factory |
|
Type Parameters
Name |
Description |
TService |
|
View Source
AddUnique<TService>(IServiceCollection, Func<IServiceProvider, TService>, ServiceLifetime)
Adds a service of type TService
with an implementation factory method to the specified .
Declaration
public static void AddUnique<TService>(this IServiceCollection services, Func<IServiceProvider, TService> factory, ServiceLifetime lifetime)
where TService : class
Parameters
Type |
Name |
Description |
IServiceCollection |
services |
|
Func<IServiceProvider, TService> |
factory |
|
ServiceLifetime |
lifetime |
|
Type Parameters
Name |
Description |
TService |
|
View Source
AddUnique<TService, TImplementing>(IServiceCollection)
Adds a service of type TService
with an implementation type of
TImplementing
to the specified .
Declaration
public static void AddUnique<TService, TImplementing>(this IServiceCollection services)
where TService : class where TImplementing : class, TService
Parameters
Type |
Name |
Description |
IServiceCollection |
services |
|
Type Parameters
Name |
Description |
TService |
|
TImplementing |
|
View Source
AddUnique<TService, TImplementing>(IServiceCollection, ServiceLifetime)
Adds a service of type TService
with an implementation type of
TImplementing
to the specified .
Declaration
public static void AddUnique<TService, TImplementing>(this IServiceCollection services, ServiceLifetime lifetime)
where TService : class where TImplementing : class, TService
Parameters
Type |
Name |
Description |
IServiceCollection |
services |
|
ServiceLifetime |
lifetime |
|
Type Parameters
Name |
Description |
TService |
|
TImplementing |
|