ServiceCollectionDescriptorExtensions.TryAddKeyedScoped Metoda

Definice

Přetížení

TryAddKeyedScoped(IServiceCollection, Type, Object, Type)

Přidá zadanou serviceScoped službu s implementací implementationType do collection , pokud typ služby ještě není zaregistrovaný.

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

Přidá zadanou serviceScoped jako službu pomocí továrny zadané v implementationFactory do objektu collection , pokud typ služby ještě není zaregistrovaný.

TryAddKeyedScoped(IServiceCollection, Type, Object)

Pokud typ služby ještě není zaregistrovaný, přidá zadanou serviceScoped službu jako službu collection .

TryAddKeyedScoped<TService,TImplementation>(IServiceCollection, Object)

Přidá zadaný TServiceScoped jako typ implementace služby zadaný v TImplementation do collection pole, pokud tento typ služby ještě není zaregistrovaný.

TryAddKeyedScoped<TService>(IServiceCollection, Object)

Pokud typ služby ještě není zaregistrovaný, přidá zadanou TServiceScoped službu jako službu collection .

TryAddKeyedScoped<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

Přidá zadanou TServiceScoped jako službu pomocí továrny zadané v implementationFactory do objektu services , pokud typ služby ještě není zaregistrovaný.

TryAddKeyedScoped(IServiceCollection, Type, Object, Type)

Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs

Přidá zadanou serviceScoped službu s implementací implementationType do collection , pokud typ služby ještě není zaregistrovaný.

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

Parametry

service
Type

Typ služby, která se má zaregistrovat.

serviceKey
Object

Klíč služby.

implementationType
Type

Typ implementace služby.

Platí pro

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

Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs

Přidá zadanou serviceScoped jako službu pomocí továrny zadané v implementationFactory do objektu collection , pokud typ služby ještě není zaregistrovaný.

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

Parametry

service
Type

Typ služby, která se má zaregistrovat.

serviceKey
Object

Klíč služby.

implementationFactory
Func<IServiceProvider,Object,Object>

Továrna, která vytváří službu.

Platí pro

TryAddKeyedScoped(IServiceCollection, Type, Object)

Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs

Pokud typ služby ještě není zaregistrovaný, přidá zadanou serviceScoped službu jako službu collection .

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

Parametry

service
Type

Typ služby, která se má zaregistrovat.

serviceKey
Object

Klíč služby.

Platí pro

TryAddKeyedScoped<TService,TImplementation>(IServiceCollection, Object)

Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs

Přidá zadaný TServiceScoped jako typ implementace služby zadaný v TImplementation do collection pole, pokud tento typ služby ještě není zaregistrovaný.

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

Parametry typu

TService

Typ služby, která se má přidat.

TImplementation

Typ implementace, která se má použít.

Parametry

serviceKey
Object

Klíč služby.

Platí pro

TryAddKeyedScoped<TService>(IServiceCollection, Object)

Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs

Pokud typ služby ještě není zaregistrovaný, přidá zadanou TServiceScoped službu jako službu collection .

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

Parametry typu

TService

Typ služby, která se má přidat.

Parametry

serviceKey
Object

Klíč služby.

Platí pro

TryAddKeyedScoped<TService>(IServiceCollection, Object, Func<IServiceProvider,Object,TService>)

Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs
Zdroj:
ServiceCollectionDescriptorExtensions.Keyed.cs

Přidá zadanou TServiceScoped jako službu pomocí továrny zadané v implementationFactory do objektu services , pokud typ služby ještě není zaregistrovaný.

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

Parametry typu

TService

Typ služby, která se má přidat.

Parametry

serviceKey
Object

Klíč služby.

implementationFactory
Func<IServiceProvider,Object,TService>

Továrna, která vytváří službu.

Platí pro