ServiceCollectionDescriptorExtensions.TryAddTransient 메서드

정의

오버로드

TryAddTransient(IServiceCollection, Type)

서비스 유형이 아직 등록되지 않은 경우 지정된 serviceTransientcollection 서비스로 추가합니다.Adds the specified service as a Transient service to the collection if the service type hasn't already been registered.

TryAddTransient(IServiceCollection, Type, Func<IServiceProvider,Object>)

서비스 유형이 아직 등록되지 않은 경우 service에 지정된 팩터리를 사용하여 지정된 TransientimplementationFactorycollection 서비스로 추가합니다.Adds the specified service as a Transient service using the factory specified in implementationFactory to the collection if the service type hasn't already been registered.

TryAddTransient(IServiceCollection, Type, Type)

서비스 유형이 아직 등록되지 않은 경우 service 구현을 사용하여 지정된 TransientimplementationTypecollection 서비스로 추가합니다.Adds the specified service as a Transient service with the implementationType implementation to the collection if the service type hasn't already been registered.

TryAddTransient<TService,TImplementation>(IServiceCollection)

서비스 유형이 아직 등록되지 않은 경우 지정된 TServiceTransient에 지정된 TImplementation 서비스 구현 형식으로 collection에 추가합니다.Adds the specified TService as a Transient service implementation type specified in TImplementation to the collection if the service type hasn't already been registered.

TryAddTransient<TService>(IServiceCollection)

서비스 유형이 아직 등록되지 않은 경우 지정된 TServiceTransientcollection 서비스로 추가합니다.Adds the specified TService as a Transient service to the collection if the service type hasn't already been registered.

TryAddTransient<TService>(IServiceCollection, Func<IServiceProvider,TService>)

서비스 유형이 아직 등록되지 않은 경우 TService에 지정된 팩터리를 사용하여 지정된 TransientimplementationFactoryservices 서비스로 추가합니다.Adds the specified TService as a Transient service using the factory specified in implementationFactory to the services if the service type hasn't already been registered.

TryAddTransient(IServiceCollection, Type)

서비스 유형이 아직 등록되지 않은 경우 지정된 serviceTransientcollection 서비스로 추가합니다.Adds the specified service as a Transient service to the collection if the service type hasn't already been registered.

public:
[System::Runtime::CompilerServices::Extension]
 static void TryAddTransient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection, Type ^ service);
public static void TryAddTransient (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, Type service);
static member TryAddTransient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type -> unit
<Extension()>
Public Sub TryAddTransient (collection As IServiceCollection, service As Type)

매개 변수

service
Type

등록할 서비스의 유형입니다.The type of the service to register.

TryAddTransient(IServiceCollection, Type, Func<IServiceProvider,Object>)

서비스 유형이 아직 등록되지 않은 경우 service에 지정된 팩터리를 사용하여 지정된 TransientimplementationFactorycollection 서비스로 추가합니다.Adds the specified service as a Transient service using the factory specified in implementationFactory to the collection if the service type hasn't already been registered.

public:
[System::Runtime::CompilerServices::Extension]
 static void TryAddTransient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection, Type ^ service, Func<IServiceProvider ^, System::Object ^> ^ implementationFactory);
public static void TryAddTransient (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, Type service, Func<IServiceProvider,object> implementationFactory);
static member TryAddTransient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * Func<IServiceProvider, obj> -> unit
<Extension()>
Public Sub TryAddTransient (collection As IServiceCollection, service As Type, implementationFactory As Func(Of IServiceProvider, Object))

매개 변수

service
Type

등록할 서비스의 유형입니다.The type of the service to register.

implementationFactory
Func<IServiceProvider,Object>

서비스를 만드는 팩터리입니다.The factory that creates the service.

TryAddTransient(IServiceCollection, Type, Type)

서비스 유형이 아직 등록되지 않은 경우 service 구현을 사용하여 지정된 TransientimplementationTypecollection 서비스로 추가합니다.Adds the specified service as a Transient service with the implementationType implementation to the collection if the service type hasn't already been registered.

public:
[System::Runtime::CompilerServices::Extension]
 static void TryAddTransient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection, Type ^ service, Type ^ implementationType);
public static void TryAddTransient (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, Type service, Type implementationType);
static member TryAddTransient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * Type -> unit
<Extension()>
Public Sub TryAddTransient (collection As IServiceCollection, service As Type, implementationType As Type)

매개 변수

service
Type

등록할 서비스의 유형입니다.The type of the service to register.

implementationType
Type

서비스의 구현 유형입니다.The implementation type of the service.

TryAddTransient<TService,TImplementation>(IServiceCollection)

서비스 유형이 아직 등록되지 않은 경우 지정된 TServiceTransient에 지정된 TImplementation 서비스 구현 형식으로 collection에 추가합니다.Adds the specified TService as a Transient service implementation type specified in TImplementation to the collection if the service type hasn't already been registered.

public:
generic <typename TService, typename TImplementation>
 where TService : class where TImplementation : class, TService[System::Runtime::CompilerServices::Extension]
 static void TryAddTransient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection);
public static void TryAddTransient<TService,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection) where TService : class where TImplementation : class, TService;
static member TryAddTransient : Microsoft.Extensions.DependencyInjection.IServiceCollection -> unit (requires 'Service : null)
<Extension()>
Public Sub TryAddTransient(Of TService As Class, TImplementation As Class) (collection As IServiceCollection)

형식 매개 변수

TService

추가할 서비스 유형입니다.The type of the service to add.

TImplementation

사용할 구현의 형식입니다.The type of the implementation to use.

매개 변수

TryAddTransient<TService>(IServiceCollection)

서비스 유형이 아직 등록되지 않은 경우 지정된 TServiceTransientcollection 서비스로 추가합니다.Adds the specified TService as a Transient service to the collection if the service type hasn't already been registered.

public:
generic <typename TService>
 where TService : class[System::Runtime::CompilerServices::Extension]
 static void TryAddTransient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection);
public static void TryAddTransient<TService> (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection) where TService : class;
static member TryAddTransient : Microsoft.Extensions.DependencyInjection.IServiceCollection -> unit (requires 'Service : null)
<Extension()>
Public Sub TryAddTransient(Of TService As Class) (collection As IServiceCollection)

형식 매개 변수

TService

추가할 서비스 유형입니다.The type of the service to add.

매개 변수

TryAddTransient<TService>(IServiceCollection, Func<IServiceProvider,TService>)

서비스 유형이 아직 등록되지 않은 경우 TService에 지정된 팩터리를 사용하여 지정된 TransientimplementationFactoryservices 서비스로 추가합니다.Adds the specified TService as a Transient service using the factory specified in implementationFactory to the services if the service type hasn't already been registered.

public:
generic <typename TService>
 where TService : class[System::Runtime::CompilerServices::Extension]
 static void TryAddTransient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Func<IServiceProvider ^, TService> ^ implementationFactory);
public static void TryAddTransient<TService> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Func<IServiceProvider,TService> implementationFactory) where TService : class;
static member TryAddTransient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<IServiceProvider, 'Service (requires 'Service : null)> -> unit (requires 'Service : null)
<Extension()>
Public Sub TryAddTransient(Of TService As Class) (services As IServiceCollection, implementationFactory As Func(Of IServiceProvider, TService))

형식 매개 변수

TService

추가할 서비스 유형입니다.The type of the service to add.

매개 변수

implementationFactory
Func<IServiceProvider,TService>

서비스를 만드는 팩터리입니다.The factory that creates the service.

적용 대상