Share via


IContainerBuilder.AddService Method

Definition

Overloads

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

Adds a service of serviceType with an implementationFactory.

AddService(ServiceLifetime, Type, Type)

Adds a service of serviceType with an implementationType.

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

Adds a service of serviceType with an implementationFactory.

public Microsoft.OData.IContainerBuilder AddService (Microsoft.OData.ServiceLifetime lifetime, Type serviceType, Func<IServiceProvider,object> implementationFactory);
abstract member AddService : Microsoft.OData.ServiceLifetime * Type * Func<IServiceProvider, obj> -> Microsoft.OData.IContainerBuilder
Public Function AddService (lifetime As ServiceLifetime, serviceType As Type, implementationFactory As Func(Of IServiceProvider, Object)) As IContainerBuilder

Parameters

lifetime
ServiceLifetime

The lifetime of the service to register.

serviceType
Type

The type of the service to register.

implementationFactory
Func<IServiceProvider,Object>

The factory that creates the service.

Returns

The IContainerBuilder instance itself.

Applies to

AddService(ServiceLifetime, Type, Type)

Adds a service of serviceType with an implementationType.

public Microsoft.OData.IContainerBuilder AddService (Microsoft.OData.ServiceLifetime lifetime, Type serviceType, Type implementationType);
abstract member AddService : Microsoft.OData.ServiceLifetime * Type * Type -> Microsoft.OData.IContainerBuilder
Public Function AddService (lifetime As ServiceLifetime, serviceType As Type, implementationType As Type) As IContainerBuilder

Parameters

lifetime
ServiceLifetime

The lifetime of the service to register.

serviceType
Type

The type of the service to register.

implementationType
Type

The implementation type of the service.

Returns

The IContainerBuilder instance itself.

Applies to