ServiceCollectionDescriptorExtensions.TryAddScoped Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Aşırı Yüklemeler
TryAddScoped(IServiceCollection, Type) |
Hizmet |
TryAddScoped(IServiceCollection, Type, Func<IServiceProvider,Object>) |
|
TryAddScoped(IServiceCollection, Type, Type) |
Hizmet türü henüz kaydedilmemişse, uygulamasıyla |
TryAddScoped<TService,TImplementation>(IServiceCollection) |
Belirtilen |
TryAddScoped<TService>(IServiceCollection) |
Hizmet |
TryAddScoped<TService>(IServiceCollection, Func<IServiceProvider,TService>) |
|
TryAddScoped(IServiceCollection, Type)
Hizmet collection
türü henüz kaydedilmemişse belirtilen service
hizmet olarak Scoped öğesini öğesine ekler.
public:
[System::Runtime::CompilerServices::Extension]
static void TryAddScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection, Type ^ service);
public static void TryAddScoped (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, Type service);
static member TryAddScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type -> unit
<Extension()>
Public Sub TryAddScoped (collection As IServiceCollection, service As Type)
Parametreler
- collection
- IServiceCollection
- service
- Type
Kaydedilecek hizmetin türü.
Şunlara uygulanır
TryAddScoped(IServiceCollection, Type, Func<IServiceProvider,Object>)
service
Hizmet türü henüz kaydedilmemişse, içinde implementationFactory
belirtilen fabrikayı collection
kullanarak belirtileni bir hizmet olarak Scoped ekler.
public:
[System::Runtime::CompilerServices::Extension]
static void TryAddScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection, Type ^ service, Func<IServiceProvider ^, System::Object ^> ^ implementationFactory);
public static void TryAddScoped (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, Type service, Func<IServiceProvider,object> implementationFactory);
static member TryAddScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * Func<IServiceProvider, obj> -> unit
<Extension()>
Public Sub TryAddScoped (collection As IServiceCollection, service As Type, implementationFactory As Func(Of IServiceProvider, Object))
Parametreler
- collection
- IServiceCollection
- service
- Type
Kaydedilecek hizmetin türü.
- implementationFactory
- Func<IServiceProvider,Object>
Hizmeti oluşturan fabrika.
Şunlara uygulanır
TryAddScoped(IServiceCollection, Type, Type)
Hizmet türü henüz kaydedilmemişse, uygulamasıyla collection
implementationType
belirtilen hizmet olarak Scoped değerini service
öğesine ekler.
public:
[System::Runtime::CompilerServices::Extension]
static void TryAddScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection, Type ^ service, Type ^ implementationType);
public static void TryAddScoped (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, Type service, Type implementationType);
static member TryAddScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * Type -> unit
<Extension()>
Public Sub TryAddScoped (collection As IServiceCollection, service As Type, implementationType As Type)
Parametreler
- collection
- IServiceCollection
- service
- Type
Kaydedilecek hizmetin türü.
- implementationType
- Type
Hizmetin uygulama türü.
Şunlara uygulanır
TryAddScoped<TService,TImplementation>(IServiceCollection)
Belirtilen TService
Scoped hizmet türü önceden kaydedilmemişse içinde belirtilen TImplementation
collection
hizmet uygulama türünü öğesine ekler.
public:
generic <typename TService, typename TImplementation>
where TService : class where TImplementation : class, TService[System::Runtime::CompilerServices::Extension]
static void TryAddScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection);
public static void TryAddScoped<TService,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection) where TService : class where TImplementation : class, TService;
static member TryAddScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection -> unit (requires 'Service : null)
<Extension()>
Public Sub TryAddScoped(Of TService As Class, TImplementation As Class) (collection As IServiceCollection)
Tür Parametreleri
- TService
Eklenecek hizmetin türü.
- TImplementation
Kullanılacak uygulamanın türü.
Parametreler
- collection
- IServiceCollection
Şunlara uygulanır
TryAddScoped<TService>(IServiceCollection)
Hizmet collection
türü henüz kaydedilmemişse belirtilen TService
hizmet olarak Scoped öğesini öğesine ekler.
public:
generic <typename TService>
where TService : class[System::Runtime::CompilerServices::Extension]
static void TryAddScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ collection);
public static void TryAddScoped<TService> (this Microsoft.Extensions.DependencyInjection.IServiceCollection collection) where TService : class;
static member TryAddScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection -> unit (requires 'Service : null)
<Extension()>
Public Sub TryAddScoped(Of TService As Class) (collection As IServiceCollection)
Tür Parametreleri
- TService
Eklenecek hizmetin türü.
Parametreler
- collection
- IServiceCollection
Şunlara uygulanır
TryAddScoped<TService>(IServiceCollection, Func<IServiceProvider,TService>)
TService
Hizmet türü henüz kaydedilmemişse, içinde implementationFactory
belirtilen fabrikayı services
kullanarak belirtileni bir hizmet olarak Scoped ekler.
public:
generic <typename TService>
where TService : class[System::Runtime::CompilerServices::Extension]
static void TryAddScoped(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Func<IServiceProvider ^, TService> ^ implementationFactory);
public static void TryAddScoped<TService> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Func<IServiceProvider,TService> implementationFactory) where TService : class;
static member TryAddScoped : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<IServiceProvider, 'Service (requires 'Service : null)> -> unit (requires 'Service : null)
<Extension()>
Public Sub TryAddScoped(Of TService As Class) (services As IServiceCollection, implementationFactory As Func(Of IServiceProvider, TService))
Tür Parametreleri
- TService
Eklenecek hizmetin türü.
Parametreler
- services
- IServiceCollection
- implementationFactory
- Func<IServiceProvider,TService>
Hizmeti oluşturan fabrika.