ServiceCollectionServiceExtensions.AddTransient メソッド

定義

オーバーロード

AddTransient(IServiceCollection, Type)

serviceType で指定した型の一時サービスを、指定した IServiceCollection に追加します。Adds a transient service of the type specified in serviceType to the specified IServiceCollection.

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

implementationFactory でファクトリを指定し、serviceType で指定した型の一時サービスを、指定した IServiceCollection に追加します。Adds a transient service of the type specified in serviceType with a factory specified in implementationFactory to the specified IServiceCollection.

AddTransient(IServiceCollection, Type, Type)

implementationType で型の実装を指定し、serviceType で指定した型の一時サービスを、指定した IServiceCollection に追加します。Adds a transient service of the type specified in serviceType with an implementation of the type specified in implementationType to the specified IServiceCollection.

AddTransient<TService,TImplementation>(IServiceCollection)

TImplementation で実装型を指定し、TService で指定した型の一時サービスを、指定した IServiceCollection に追加します。Adds a transient service of the type specified in TService with an implementation type specified in TImplementation to the specified IServiceCollection.

AddTransient<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

implementationFactory で指定したファクトリを使用して TImplementation で実装型を指定し、TService で指定した型の一時サービスを、指定した IServiceCollection に追加します。Adds a transient service of the type specified in TService with an implementation type specified in TImplementation using the factory specified in implementationFactory to the specified IServiceCollection.

AddTransient<TService>(IServiceCollection)

TService で指定した型の一時サービスを、指定した IServiceCollection に追加します。Adds a transient service of the type specified in TService to the specified IServiceCollection.

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

implementationFactory でファクトリを指定し、TService で指定した型の一時サービスを、指定した IServiceCollection に追加します。Adds a transient service of the type specified in TService with a factory specified in implementationFactory to the specified IServiceCollection.

AddTransient(IServiceCollection, Type)

serviceType で指定した型の一時サービスを、指定した IServiceCollection に追加します。Adds a transient service of the type specified in serviceType to the specified IServiceCollection.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddTransient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Type ^ serviceType);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddTransient (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Type serviceType);
static member AddTransient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddTransient (services As IServiceCollection, serviceType As Type) As IServiceCollection

パラメーター

services
IServiceCollection

サービスを追加する先の IServiceCollectionThe IServiceCollection to add the service to.

serviceType
Type

登録するサービスの型と使用する実装。The type of the service to register and the implementation to use.

戻り値

IServiceCollection

操作が完了した後のこのインスタンスへの参照。A reference to this instance after the operation has completed.

こちらもご覧ください

適用対象

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

implementationFactory でファクトリを指定し、serviceType で指定した型の一時サービスを、指定した IServiceCollection に追加します。Adds a transient service of the type specified in serviceType with a factory specified in implementationFactory to the specified IServiceCollection.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddTransient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Type ^ serviceType, Func<IServiceProvider ^, System::Object ^> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddTransient (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Type serviceType, Func<IServiceProvider,object> implementationFactory);
static member AddTransient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * Func<IServiceProvider, obj> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddTransient (services As IServiceCollection, serviceType As Type, implementationFactory As Func(Of IServiceProvider, Object)) As IServiceCollection

パラメーター

services
IServiceCollection

サービスを追加する先の IServiceCollectionThe IServiceCollection to add the service to.

serviceType
Type

登録するサービスの型。The type of the service to register.

implementationFactory
Func<IServiceProvider,Object>

サービスを作成するファクトリ。The factory that creates the service.

戻り値

IServiceCollection

操作が完了した後のこのインスタンスへの参照。A reference to this instance after the operation has completed.

こちらもご覧ください

適用対象

AddTransient(IServiceCollection, Type, Type)

implementationType で型の実装を指定し、serviceType で指定した型の一時サービスを、指定した IServiceCollection に追加します。Adds a transient service of the type specified in serviceType with an implementation of the type specified in implementationType to the specified IServiceCollection.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddTransient(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Type ^ serviceType, Type ^ implementationType);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddTransient (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Type serviceType, Type implementationType);
static member AddTransient : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * Type -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddTransient (services As IServiceCollection, serviceType As Type, implementationType As Type) As IServiceCollection

パラメーター

services
IServiceCollection

サービスを追加する先の IServiceCollectionThe IServiceCollection to add the service to.

serviceType
Type

登録するサービスの型。The type of the service to register.

implementationType
Type

サービスの実装の型。The implementation type of the service.

戻り値

IServiceCollection

操作が完了した後のこのインスタンスへの参照。A reference to this instance after the operation has completed.

こちらもご覧ください

適用対象

AddTransient<TService,TImplementation>(IServiceCollection)

TImplementation で実装型を指定し、TService で指定した型の一時サービスを、指定した IServiceCollection に追加します。Adds a transient service of the type specified in TService with an implementation type specified in TImplementation to the specified IServiceCollection.

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

型パラメーター

TService

追加するサービスの種類。The type of the service to add.

TImplementation

使用する実装の型。The type of the implementation to use.

パラメーター

services
IServiceCollection

サービスを追加する先の IServiceCollectionThe IServiceCollection to add the service to.

戻り値

IServiceCollection

操作が完了した後のこのインスタンスへの参照。A reference to this instance after the operation has completed.

こちらもご覧ください

適用対象

AddTransient<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

implementationFactory で指定したファクトリを使用して TImplementation で実装型を指定し、TService で指定した型の一時サービスを、指定した IServiceCollection に追加します。Adds a transient service of the type specified in TService with an implementation type specified in TImplementation using the factory specified in implementationFactory to the specified IServiceCollection.

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

型パラメーター

TService

追加するサービスの種類。The type of the service to add.

TImplementation

使用する実装の型。The type of the implementation to use.

パラメーター

services
IServiceCollection

サービスを追加する先の IServiceCollectionThe IServiceCollection to add the service to.

implementationFactory
Func<IServiceProvider,TImplementation>

サービスを作成するファクトリ。The factory that creates the service.

戻り値

IServiceCollection

操作が完了した後のこのインスタンスへの参照。A reference to this instance after the operation has completed.

こちらもご覧ください

適用対象

AddTransient<TService>(IServiceCollection)

TService で指定した型の一時サービスを、指定した IServiceCollection に追加します。Adds a transient service of the type specified in TService to the specified IServiceCollection.

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

型パラメーター

TService

追加するサービスの種類。The type of the service to add.

パラメーター

services
IServiceCollection

サービスを追加する先の IServiceCollectionThe IServiceCollection to add the service to.

戻り値

IServiceCollection

操作が完了した後のこのインスタンスへの参照。A reference to this instance after the operation has completed.

こちらもご覧ください

適用対象

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

implementationFactory でファクトリを指定し、TService で指定した型の一時サービスを、指定した IServiceCollection に追加します。Adds a transient service of the type specified in TService with a factory specified in implementationFactory to the specified IServiceCollection.

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

型パラメーター

TService

追加するサービスの種類。The type of the service to add.

パラメーター

services
IServiceCollection

サービスを追加する先の IServiceCollectionThe IServiceCollection to add the service to.

implementationFactory
Func<IServiceProvider,TService>

サービスを作成するファクトリ。The factory that creates the service.

戻り値

IServiceCollection

操作が完了した後のこのインスタンスへの参照。A reference to this instance after the operation has completed.

こちらもご覧ください

適用対象