Condividi tramite


ServiceCollectionMap.TryAddScoped Metodo

Definizione

Overload

TryAddScoped(Type, Func<IServiceProvider,Object>)

Aggiunge un Scoped servizio implementato dalla factory specificata se non è già stato registrato alcun servizio per il tipo di servizio specificato.

TryAddScoped(Type, Type)

Aggiunge un Scoped servizio implementato dal tipo concreto specificato se non è già stato registrato alcun servizio per il tipo di servizio specificato.

TryAddScoped<TService,TImplementation>()

Aggiunge un Scoped servizio implementato dal tipo concreto specificato se non è già stato registrato alcun servizio per il tipo di servizio specificato.

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

Aggiunge un Scoped servizio implementato dalla factory specificata se non è già stato registrato alcun servizio per il tipo di servizio specificato.

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

Aggiunge un Scoped servizio implementato dalla factory specificata se non è già stato registrato alcun servizio per il tipo di servizio specificato.

TryAddScoped(Type, Func<IServiceProvider,Object>)

Aggiunge un Scoped servizio implementato dalla factory specificata se non è già stato registrato alcun servizio per il tipo di servizio specificato.

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

Parametri

serviceType
Type

Contratto per il servizio.

factory
Func<IServiceProvider,Object>

Factory che implementa il servizio.

Restituisce

La mappa, in modo che sia possibile concatenare altre chiamate.

Si applica a

TryAddScoped(Type, Type)

Aggiunge un Scoped servizio implementato dal tipo concreto specificato se non è già stato registrato alcun servizio per il tipo di servizio specificato.

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

Parametri

serviceType
Type

Contratto per il servizio.

implementationType
Type

Tipo concreto che implementa il servizio.

Restituisce

La mappa, in modo che sia possibile concatenare altre chiamate.

Si applica a

TryAddScoped<TService,TImplementation>()

Aggiunge un Scoped servizio implementato dal tipo concreto specificato se non è già stato registrato alcun servizio per il tipo di servizio specificato.

public virtual Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap TryAddScoped<TService,TImplementation> () where TService : class where TImplementation : class, TService;
abstract member TryAddScoped : unit -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap (requires 'Service : null)
override this.TryAddScoped : unit -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap (requires 'Service : null)
Public Overridable Function TryAddScoped(Of TService As Class, TImplementation As Class) () As ServiceCollectionMap

Parametri di tipo

TService

Contratto per il servizio.

TImplementation

Tipo concreto che implementa il servizio.

Restituisce

La mappa, in modo che sia possibile concatenare altre chiamate.

Si applica a

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

Aggiunge un Scoped servizio implementato dalla factory specificata se non è già stato registrato alcun servizio per il tipo di servizio specificato.

public virtual Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap TryAddScoped<TService,TImplementation> (Func<IServiceProvider,TImplementation> factory) where TService : class where TImplementation : class, TService;
abstract member TryAddScoped : Func<IServiceProvider, #'Service> -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap (requires 'Service : null)
override this.TryAddScoped : Func<IServiceProvider, #'Service> -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap (requires 'Service : null)
Public Overridable Function TryAddScoped(Of TService As Class, TImplementation As Class) (factory As Func(Of IServiceProvider, TImplementation)) As ServiceCollectionMap

Parametri di tipo

TService

Contratto per il servizio.

TImplementation

Tipo concreto creato dalla factory specificata.

Parametri

factory
Func<IServiceProvider,TImplementation>

Factory che implementa il servizio.

Restituisce

La mappa, in modo che sia possibile concatenare altre chiamate.

Si applica a

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

Aggiunge un Scoped servizio implementato dalla factory specificata se non è già stato registrato alcun servizio per il tipo di servizio specificato.

public virtual Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap TryAddScoped<TService> (Func<IServiceProvider,TService> factory) where TService : class;
abstract member TryAddScoped : Func<IServiceProvider, 'Service (requires 'Service : null)> -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap (requires 'Service : null)
override this.TryAddScoped : Func<IServiceProvider, 'Service (requires 'Service : null)> -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap (requires 'Service : null)
Public Overridable Function TryAddScoped(Of TService As Class) (factory As Func(Of IServiceProvider, TService)) As ServiceCollectionMap

Parametri di tipo

TService

Contratto per il servizio.

Parametri

factory
Func<IServiceProvider,TService>

Factory che implementa il servizio.

Restituisce

La mappa, in modo che sia possibile concatenare altre chiamate.

Si applica a