ServiceCollectionMap.TryAddScoped Yöntem

Tanım

Aşırı Yüklemeler

TryAddScoped(Type, Func<IServiceProvider,Object>)

Belirtilen Scoped hizmet türü için hiçbir hizmet zaten kayıtlı değilse, verilen fabrika tarafından uygulanan bir hizmet ekler.

TryAddScoped(Type, Type)

Belirtilen Scoped hizmet türü için hiçbir hizmet zaten kayıtlı değilse, belirtilen somut tür tarafından uygulanan bir hizmet ekler.

TryAddScoped<TService,TImplementation>()

Belirtilen Scoped hizmet türü için hiçbir hizmet zaten kayıtlı değilse, belirtilen somut tür tarafından uygulanan bir hizmet ekler.

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

Belirtilen Scoped hizmet türü için hiçbir hizmet zaten kayıtlı değilse, verilen fabrika tarafından uygulanan bir hizmet ekler.

TryAddScoped<TService>(Func<IServiceProvider,TService>)

Belirtilen Scoped hizmet türü için hiçbir hizmet zaten kayıtlı değilse, verilen fabrika tarafından uygulanan bir hizmet ekler.

TryAddScoped(Type, Func<IServiceProvider,Object>)

Belirtilen Scoped hizmet türü için hiçbir hizmet zaten kayıtlı değilse, verilen fabrika tarafından uygulanan bir hizmet ekler.

public virtual Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap TryAddScoped (Type serviceType, Func<IServiceProvider,object> factory);
abstract member TryAddScoped : Type * Func<IServiceProvider, obj> -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
override this.TryAddScoped : Type * Func<IServiceProvider, obj> -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
Public Overridable Function TryAddScoped (serviceType As Type, factory As Func(Of IServiceProvider, Object)) As ServiceCollectionMap

Parametreler

serviceType
Type

Hizmetin sözleşmesi.

factory
Func<IServiceProvider,Object>

Hizmeti uygulayan fabrika.

Döndürülenler

ServiceCollectionMap

Harita, başka çağrılar zincirleme şekilde.

Şunlara uygulanır

TryAddScoped(Type, Type)

Belirtilen Scoped hizmet türü için hiçbir hizmet zaten kayıtlı değilse, belirtilen somut tür tarafından uygulanan bir hizmet ekler.

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

Parametreler

serviceType
Type

Hizmetin sözleşmesi.

implementationType
Type

Hizmeti uygulayan somut tür.

Döndürülenler

ServiceCollectionMap

Harita, başka çağrılar zincirleme şekilde.

Şunlara uygulanır

TryAddScoped<TService,TImplementation>()

Belirtilen Scoped hizmet türü için hiçbir hizmet zaten kayıtlı değilse, belirtilen somut tür tarafından uygulanan bir hizmet ekler.

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

Tür Parametreleri

TService

Hizmetin sözleşmesi.

TImplementation

Hizmeti uygulayan somut tür.

Döndürülenler

ServiceCollectionMap

Harita, başka çağrılar zincirleme şekilde.

Şunlara uygulanır

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

Belirtilen Scoped hizmet türü için hiçbir hizmet zaten kayıtlı değilse, verilen fabrika tarafından uygulanan bir hizmet ekler.

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

Tür Parametreleri

TService

Hizmetin sözleşmesi.

TImplementation

Verilen fabrikanın oluşturduğu somut tür.

Parametreler

factory
Func<IServiceProvider,TImplementation>

Hizmeti uygulayan fabrika.

Döndürülenler

ServiceCollectionMap

Harita, başka çağrılar zincirleme şekilde.

Şunlara uygulanır

TryAddScoped<TService>(Func<IServiceProvider,TService>)

Belirtilen Scoped hizmet türü için hiçbir hizmet zaten kayıtlı değilse, verilen fabrika tarafından uygulanan bir hizmet ekler.

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

Tür Parametreleri

TService

Hizmetin sözleşmesi.

Parametreler

factory
Func<IServiceProvider,TService>

Hizmeti uygulayan fabrika.

Döndürülenler

ServiceCollectionMap

Harita, başka çağrılar zincirleme şekilde.

Şunlara uygulanır