Compartilhar via


ContainerBuilderExtensions.AddService Método

Definição

Sobrecargas

AddService(IContainerBuilder, ServiceLifetime, Type)

Adiciona um serviço de serviceType.

AddService<TService,TImplementation>(IContainerBuilder, ServiceLifetime)

Adiciona um serviço de TService com um TImplementation.

AddService<TService>(IContainerBuilder, ServiceLifetime)

Adiciona um serviço de TService.

AddService<TService>(IContainerBuilder, ServiceLifetime, Func<IServiceProvider,TService>)

Adiciona um serviço de TService com um implementationFactory.

AddService(IContainerBuilder, ServiceLifetime, Type)

Adiciona um serviço de serviceType.

public static Microsoft.OData.IContainerBuilder AddService (this Microsoft.OData.IContainerBuilder builder, Microsoft.OData.ServiceLifetime lifetime, Type serviceType);
static member AddService : Microsoft.OData.IContainerBuilder * Microsoft.OData.ServiceLifetime * Type -> Microsoft.OData.IContainerBuilder
<Extension()>
Public Function AddService (builder As IContainerBuilder, lifetime As ServiceLifetime, serviceType As Type) As IContainerBuilder

Parâmetros

builder
IContainerBuilder

O IContainerBuilder ao qual adicionar o serviço.

lifetime
ServiceLifetime

O tempo de vida do serviço a ser registrado.

serviceType
Type

O tipo de serviço a ser registrado e a implementação a ser usada.

Retornos

A IContainerBuilder própria instância.

Aplica-se a

AddService<TService,TImplementation>(IContainerBuilder, ServiceLifetime)

Adiciona um serviço de TService com um TImplementation.

public static Microsoft.OData.IContainerBuilder AddService<TService,TImplementation> (this Microsoft.OData.IContainerBuilder builder, Microsoft.OData.ServiceLifetime lifetime) where TService : class where TImplementation : class, TService;
static member AddService : Microsoft.OData.IContainerBuilder * Microsoft.OData.ServiceLifetime -> Microsoft.OData.IContainerBuilder (requires 'Service : null)
<Extension()>
Public Function AddService(Of TService As Class, TImplementation As Class) (builder As IContainerBuilder, lifetime As ServiceLifetime) As IContainerBuilder

Parâmetros de tipo

TService

O tipo do serviço a adicionar.

TImplementation

O tipo da implementação a ser usada.

Parâmetros

builder
IContainerBuilder

O IContainerBuilder ao qual adicionar o serviço.

lifetime
ServiceLifetime

O tempo de vida do serviço a ser registrado.

Retornos

A IContainerBuilder própria instância.

Aplica-se a

AddService<TService>(IContainerBuilder, ServiceLifetime)

Adiciona um serviço de TService.

public static Microsoft.OData.IContainerBuilder AddService<TService> (this Microsoft.OData.IContainerBuilder builder, Microsoft.OData.ServiceLifetime lifetime) where TService : class;
static member AddService : Microsoft.OData.IContainerBuilder * Microsoft.OData.ServiceLifetime -> Microsoft.OData.IContainerBuilder (requires 'Service : null)
<Extension()>
Public Function AddService(Of TService As Class) (builder As IContainerBuilder, lifetime As ServiceLifetime) As IContainerBuilder

Parâmetros de tipo

TService

O tipo do serviço a adicionar.

Parâmetros

builder
IContainerBuilder

O IContainerBuilder ao qual adicionar o serviço.

lifetime
ServiceLifetime

O tempo de vida do serviço a ser registrado.

Retornos

A IContainerBuilder própria instância.

Aplica-se a

AddService<TService>(IContainerBuilder, ServiceLifetime, Func<IServiceProvider,TService>)

Adiciona um serviço de TService com um implementationFactory.

public static Microsoft.OData.IContainerBuilder AddService<TService> (this Microsoft.OData.IContainerBuilder builder, Microsoft.OData.ServiceLifetime lifetime, Func<IServiceProvider,TService> implementationFactory) where TService : class;
static member AddService : Microsoft.OData.IContainerBuilder * Microsoft.OData.ServiceLifetime * Func<IServiceProvider, 'Service (requires 'Service : null)> -> Microsoft.OData.IContainerBuilder (requires 'Service : null)
<Extension()>
Public Function AddService(Of TService As Class) (builder As IContainerBuilder, lifetime As ServiceLifetime, implementationFactory As Func(Of IServiceProvider, TService)) As IContainerBuilder

Parâmetros de tipo

TService

O tipo do serviço a adicionar.

Parâmetros

builder
IContainerBuilder

O IContainerBuilder ao qual adicionar o serviço.

lifetime
ServiceLifetime

O tempo de vida do serviço a ser registrado.

implementationFactory
Func<IServiceProvider,TService>

O alocador que cria o serviço.

Retornos

A IContainerBuilder própria instância.

Aplica-se a