ServiceCollectionDescriptorExtensions.TryAddScoped メソッド

定義

オーバーロード

TryAddScoped(IServiceCollection, Type)

サービスの種類がまだ登録されていない場合、指定の serviceScoped サービスとして collection に追加します。

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

サービスの種類がまだ登録されていない場合、指定の serviceScoped サービスとして、implementationFactory に指定されているファクトリを利用し、collection に追加します。

TryAddScoped(IServiceCollection, Type, Type)

サービスの種類がまだ登録されていない場合、指定の serviceScoped サービスとして implementationType 実装で collection に追加します。

TryAddScoped<TService,TImplementation>(IServiceCollection)

サービスの種類がまだ登録されていない場合、指定の TServiceScoped サービスとして、TImplementation に指定されている実装の種類を利用し、collection に追加します。

TryAddScoped<TService>(IServiceCollection)

サービスの種類がまだ登録されていない場合、指定の TServiceScoped サービスとして collection に追加します。

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

サービスの種類がまだ登録されていない場合、指定の TServiceScoped サービスとして、implementationFactory に指定されているファクトリを利用し、services に追加します。

TryAddScoped(IServiceCollection, Type)

ソース:
ServiceCollectionDescriptorExtensions.cs
ソース:
ServiceCollectionDescriptorExtensions.cs
ソース:
ServiceCollectionDescriptorExtensions.cs

サービスの種類がまだ登録されていない場合、指定の serviceScoped サービスとして collection に追加します。

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

パラメーター

service
Type

登録するサービスの型。

適用対象

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

ソース:
ServiceCollectionDescriptorExtensions.cs
ソース:
ServiceCollectionDescriptorExtensions.cs
ソース:
ServiceCollectionDescriptorExtensions.cs

サービスの種類がまだ登録されていない場合、指定の serviceScoped サービスとして、implementationFactory に指定されているファクトリを利用し、collection に追加します。

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

パラメーター

service
Type

登録するサービスの型。

implementationFactory
Func<IServiceProvider,Object>

サービスを作成するファクトリ。

適用対象

TryAddScoped(IServiceCollection, Type, Type)

ソース:
ServiceCollectionDescriptorExtensions.cs
ソース:
ServiceCollectionDescriptorExtensions.cs
ソース:
ServiceCollectionDescriptorExtensions.cs

サービスの種類がまだ登録されていない場合、指定の serviceScoped サービスとして implementationType 実装で collection に追加します。

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

パラメーター

service
Type

登録するサービスの型。

implementationType
Type

サービスの実装の型。

適用対象

TryAddScoped<TService,TImplementation>(IServiceCollection)

ソース:
ServiceCollectionDescriptorExtensions.cs
ソース:
ServiceCollectionDescriptorExtensions.cs
ソース:
ServiceCollectionDescriptorExtensions.cs

サービスの種類がまだ登録されていない場合、指定の TServiceScoped サービスとして、TImplementation に指定されている実装の種類を利用し、collection に追加します。

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

型パラメーター

TService

追加するサービスの種類。

TImplementation

使用する実装の型。

パラメーター

適用対象

TryAddScoped<TService>(IServiceCollection)

ソース:
ServiceCollectionDescriptorExtensions.cs
ソース:
ServiceCollectionDescriptorExtensions.cs
ソース:
ServiceCollectionDescriptorExtensions.cs

サービスの種類がまだ登録されていない場合、指定の TServiceScoped サービスとして collection に追加します。

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

型パラメーター

TService

追加するサービスの種類。

パラメーター

適用対象

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

ソース:
ServiceCollectionDescriptorExtensions.cs
ソース:
ServiceCollectionDescriptorExtensions.cs
ソース:
ServiceCollectionDescriptorExtensions.cs

サービスの種類がまだ登録されていない場合、指定の TServiceScoped サービスとして、implementationFactory に指定されているファクトリを利用し、services に追加します。

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

型パラメーター

TService

追加するサービスの種類。

パラメーター

implementationFactory
Func<IServiceProvider,TService>

サービスを作成するファクトリ。

適用対象