Compartilhar via


ServiceCollectionMap.TryAddTransient Método

Definição

Sobrecargas

TryAddTransient(Type, Func<IServiceProvider,Object>)

Adiciona um Transient serviço implementado pela fábrica especificada se nenhum serviço para o tipo de serviço fornecido já tiver sido registrado.

TryAddTransient(Type, Type)

Adiciona um Transient serviço implementado pelo tipo concreto fornecido se nenhum serviço para o tipo de serviço fornecido já tiver sido registrado.

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

Adiciona um Transient serviço implementado pela fábrica especificada se nenhum serviço para o tipo de serviço fornecido já tiver sido registrado.

TryAddTransient<TService,TImplementation>()

Adiciona um Transient serviço implementado pelo tipo concreto fornecido se nenhum serviço para o tipo de serviço fornecido já tiver sido registrado.

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

Adiciona um Transient serviço implementado pela fábrica especificada se nenhum serviço para o tipo de serviço fornecido já tiver sido registrado.

TryAddTransient(Type, Func<IServiceProvider,Object>)

Adiciona um Transient serviço implementado pela fábrica especificada se nenhum serviço para o tipo de serviço fornecido já tiver sido registrado.

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

Parâmetros

serviceType
Type

O contrato do serviço.

factory
Func<IServiceProvider,Object>

A fábrica que implementa o serviço.

Retornos

O mapa, de modo que outras chamadas possam ser encadeadas.

Aplica-se a

TryAddTransient(Type, Type)

Adiciona um Transient serviço implementado pelo tipo concreto fornecido se nenhum serviço para o tipo de serviço fornecido já tiver sido registrado.

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

Parâmetros

serviceType
Type

O contrato do serviço.

implementationType
Type

O tipo concreto que implementa o serviço.

Retornos

O mapa, de modo que outras chamadas possam ser encadeadas.

Aplica-se a

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

Adiciona um Transient serviço implementado pela fábrica especificada se nenhum serviço para o tipo de serviço fornecido já tiver sido registrado.

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

Parâmetros de tipo

TService

O contrato do serviço.

TImplementation

O tipo concreto que a fábrica fornecida cria.

Parâmetros

factory
Func<IServiceProvider,TImplementation>

A fábrica que implementa o serviço.

Retornos

O mapa, de modo que outras chamadas possam ser encadeadas.

Aplica-se a

TryAddTransient<TService,TImplementation>()

Adiciona um Transient serviço implementado pelo tipo concreto fornecido se nenhum serviço para o tipo de serviço fornecido já tiver sido registrado.

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

Parâmetros de tipo

TService

O contrato do serviço.

TImplementation

O tipo concreto que implementa o serviço.

Retornos

O mapa, de modo que outras chamadas possam ser encadeadas.

Aplica-se a

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

Adiciona um Transient serviço implementado pela fábrica especificada se nenhum serviço para o tipo de serviço fornecido já tiver sido registrado.

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

Parâmetros de tipo

TService

O contrato do serviço.

Parâmetros

factory
Func<IServiceProvider,TService>

A fábrica que implementa o serviço.

Retornos

O mapa, de modo que outras chamadas possam ser encadeadas.

Aplica-se a