Jazyk

ServiceCollectionMap.TryAdd Metoda

Definice

Přetížení

Název Description
TryAdd(Type, Func<IServiceProvider,Object>, ServiceLifetime)

Přidá službu implementovanou danou továrnou, pokud už není zaregistrovaná žádná služba pro daný typ služby.

TryAdd(Type, Type, ServiceLifetime)

Přidá službu implementovanou daným konkrétním typem, pokud již nebyla zaregistrována žádná služba pro daný typ služby.

TryAdd(Type, Func<IServiceProvider,Object>, ServiceLifetime)

Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs

Přidá službu implementovanou danou továrnou, pokud už není zaregistrovaná žádná služba pro daný typ služby.

public virtual Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap TryAdd(Type serviceType, Func<IServiceProvider,object> factory, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime);
abstract member TryAdd : Type * Func<IServiceProvider, obj> * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
override this.TryAdd : Type * Func<IServiceProvider, obj> * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
Public Overridable Function TryAdd (serviceType As Type, factory As Func(Of IServiceProvider, Object), lifetime As ServiceLifetime) As ServiceCollectionMap

Parametry

serviceType
Type

Smlouva o službě.

factory
Func<IServiceProvider,Object>

Objekt pro vytváření, který službu implementuje.

lifetime
ServiceLifetime

Životnost služby.

Návraty

Mapa tak, aby další volání bylo možné zřetězit.

Platí pro

TryAdd(Type, Type, ServiceLifetime)

Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs
Zdroj:
ServiceCollectionMap.cs

Přidá službu implementovanou daným konkrétním typem, pokud již nebyla zaregistrována žádná služba pro daný typ služby.

public virtual Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap TryAdd(Type serviceType, Type implementationType, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime);
abstract member TryAdd : Type * Type * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
override this.TryAdd : Type * Type * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
Public Overridable Function TryAdd (serviceType As Type, implementationType As Type, lifetime As ServiceLifetime) As ServiceCollectionMap

Parametry

serviceType
Type

Smlouva o službě.

implementationType
Type

Konkrétní typ, který implementuje službu.

lifetime
ServiceLifetime

Životnost služby.

Návraty

Mapa tak, aby další volání bylo možné zřetězit.

Platí pro