ServiceCollectionMap.TryAddScopedEnumerable Method

Definition

Overloads

TryAddScopedEnumerable(Type, Type)

Adds a Scoped service implemented by the given concrete type to the list of services that implement the given contract. The service is only added if the collection contains no other registration for the same service and implementation type.

TryAddScopedEnumerable<TService,TImplementation>()

Adds a Scoped service implemented by the given concrete type to the list of services that implement the given contract. The service is only added if the collection contains no other registration for the same service and implementation type.

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

Adds a Scoped service implemented by the given factory to the list of services that implement the given contract. The service is only added if the collection contains no other registration for the same service and implementation type.

TryAddScopedEnumerable(Type, Type)

Adds a Scoped service implemented by the given concrete type to the list of services that implement the given contract. The service is only added if the collection contains no other registration for the same service and implementation type.

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

Parameters

serviceType
Type

The contract for the service.

implementationType
Type

The concrete type that implements the service.

Returns

The map, such that further calls can be chained.

Applies to

TryAddScopedEnumerable<TService,TImplementation>()

Adds a Scoped service implemented by the given concrete type to the list of services that implement the given contract. The service is only added if the collection contains no other registration for the same service and implementation type.

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

Type Parameters

TService

The contract for the service.

TImplementation

The concrete type that implements the service.

Returns

The map, such that further calls can be chained.

Applies to

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

Adds a Scoped service implemented by the given factory to the list of services that implement the given contract. The service is only added if the collection contains no other registration for the same service and implementation type.

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

Type Parameters

TService

The contract for the service.

TImplementation

The concrete type that implements the service.

Parameters

factory
Func<IServiceProvider,TImplementation>

The factory that implements this service.

Returns

The map, such that further calls can be chained.

Applies to