Udostępnij za pośrednictwem


ServiceCollectionMap.TryAddScopedEnumerable Metoda

Definicja

Przeciążenia

TryAddScopedEnumerable(Type, Type)

Dodaje usługę Scoped zaimplementowaną przez określony typ do listy usług, które implementują dany kontrakt. Usługa jest dodawana tylko wtedy, gdy kolekcja nie zawiera żadnej innego rejestracji dla tej samej usługi i typu implementacji.

TryAddScopedEnumerable<TService,TImplementation>()

Dodaje usługę Scoped zaimplementowaną przez określony typ do listy usług, które implementują dany kontrakt. Usługa jest dodawana tylko wtedy, gdy kolekcja nie zawiera żadnej innego rejestracji dla tej samej usługi i typu implementacji.

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

Dodaje usługę zaimplementowaną przez daną Scoped fabrykę do listy usług, które implementują dany kontrakt. Usługa jest dodawana tylko wtedy, gdy kolekcja nie zawiera żadnej innego rejestracji dla tej samej usługi i typu implementacji.

TryAddScopedEnumerable(Type, Type)

Dodaje usługę Scoped zaimplementowaną przez określony typ do listy usług, które implementują dany kontrakt. Usługa jest dodawana tylko wtedy, gdy kolekcja nie zawiera żadnej innego rejestracji dla tej samej usługi i typu implementacji.

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

Parametry

serviceType
Type

Umowa dotycząca usługi.

implementationType
Type

Konkretny typ, który implementuje usługę.

Zwraca

Mapa, dzięki czemu można połączyć kolejne wywołania.

Dotyczy

TryAddScopedEnumerable<TService,TImplementation>()

Dodaje usługę Scoped zaimplementowaną przez określony typ do listy usług, które implementują dany kontrakt. Usługa jest dodawana tylko wtedy, gdy kolekcja nie zawiera żadnej innego rejestracji dla tej samej usługi i typu implementacji.

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

Parametry typu

TService

Umowa dotycząca usługi.

TImplementation

Konkretny typ, który implementuje usługę.

Zwraca

Mapa, dzięki czemu można połączyć kolejne wywołania.

Dotyczy

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

Dodaje usługę zaimplementowaną przez daną Scoped fabrykę do listy usług, które implementują dany kontrakt. Usługa jest dodawana tylko wtedy, gdy kolekcja nie zawiera żadnej innego rejestracji dla tej samej usługi i typu implementacji.

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

Parametry typu

TService

Umowa dotycząca usługi.

TImplementation

Konkretny typ, który implementuje usługę.

Parametry

factory
Func<IServiceProvider,TImplementation>

Fabryka, która implementuje tę usługę.

Zwraca

Mapa, dzięki czemu można połączyć kolejne wywołania.

Dotyczy