ServiceCollectionMap.TryAddTransientEnumerable Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
TryAddTransientEnumerable(Type, Type) |
Adds a Transient 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. |
TryAddTransientEnumerable<TService,TImplementation>() |
Adds a Transient 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. |
TryAddTransientEnumerable<TService,TImplementation>(Func<IServiceProvider,TImplementation>) |
Adds a Transient 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. |
TryAddTransientEnumerable(Type, Type)
Adds a Transient 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 TryAddTransientEnumerable (Type serviceType, Type implementationType);
abstract member TryAddTransientEnumerable : Type * Type -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
override this.TryAddTransientEnumerable : Type * Type -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
Public Overridable Function TryAddTransientEnumerable (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
TryAddTransientEnumerable<TService,TImplementation>()
Adds a Transient 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 TryAddTransientEnumerable<TService,TImplementation> () where TService : class where TImplementation : class, TService;
abstract member TryAddTransientEnumerable : unit -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap (requires 'Service : null)
override this.TryAddTransientEnumerable : unit -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap (requires 'Service : null)
Public Overridable Function TryAddTransientEnumerable(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
TryAddTransientEnumerable<TService,TImplementation>(Func<IServiceProvider,TImplementation>)
Adds a Transient 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 TryAddTransientEnumerable<TService,TImplementation> (Func<IServiceProvider,TImplementation> factory) where TService : class where TImplementation : class, TService;
abstract member TryAddTransientEnumerable : Func<IServiceProvider, #'Service> -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap (requires 'Service : null)
override this.TryAddTransientEnumerable : Func<IServiceProvider, #'Service> -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap (requires 'Service : null)
Public Overridable Function TryAddTransientEnumerable(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
Entity Framework