Aracılığıyla paylaş


ServiceCollectionServiceExtensions.AddSingleton Yöntem

Tanım

Aşırı Yüklemeler

AddSingleton(IServiceCollection, Type, Object)

içinde belirtilen serviceType türde bir tekil hizmet ekler ve belirtilen IServiceCollectionöğesine içinde belirtilen implementationInstance bir örnek ekler.

AddSingleton(IServiceCollection, Type, Type)

içinde belirtilen serviceType türün bir uygulamasıyla implementationTypeIServiceCollectionbelirtilen türde bir tekil hizmet ekler.

AddSingleton(IServiceCollection, Type)

belirtilen serviceTypeIServiceCollectiontürüne tekil bir hizmet ekler.

AddSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>)

içinde belirtilen fabrika ile belirtilen serviceType türde bir implementationFactoryIServiceCollectiontekil hizmet ekler.

AddSingleton<TService,TImplementation>(IServiceCollection)

içinde belirtilen türde, içinde belirtilen TService uygulama türüyle TImplementation belirtilen IServiceCollectiontürde bir tekil hizmet ekler.

AddSingleton<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

içinde belirtilen TService fabrikayı kullanarak implementationFactory belirtilen uygulama türüyle belirtilen IServiceCollectiontürde TImplementation bir tekil hizmet ekler.

AddSingleton<TService>(IServiceCollection)

belirtilen TServiceIServiceCollectiontürüne tekil bir hizmet ekler.

AddSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)

içinde belirtilen fabrika ile belirtilen TService türde bir implementationFactoryIServiceCollectiontekil hizmet ekler.

AddSingleton<TService>(IServiceCollection, TService)

içinde belirtilen TService türde bir tekil hizmet ekler ve belirtilen IServiceCollectionöğesine içinde belirtilen implementationInstance bir örnek ekler.

AddSingleton(IServiceCollection, Type, Object)

Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs

içinde belirtilen serviceType türde bir tekil hizmet ekler ve belirtilen IServiceCollectionöğesine içinde belirtilen implementationInstance bir örnek ekler.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Type ^ serviceType, System::Object ^ implementationInstance);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSingleton (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Type serviceType, object implementationInstance);
static member AddSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * obj -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddSingleton (services As IServiceCollection, serviceType As Type, implementationInstance As Object) As IServiceCollection

Parametreler

services
IServiceCollection

IServiceCollection Hizmeti eklemek için.

serviceType
Type

Kaydedilecek hizmetin türü.

implementationInstance
Object

Hizmetin örneği.

Döndürülenler

İşlem tamamlandıktan sonra bu örneğe başvuru.

Ayrıca bkz.

Şunlara uygulanır

AddSingleton(IServiceCollection, Type, Type)

Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs

içinde belirtilen serviceType türün bir uygulamasıyla implementationTypeIServiceCollectionbelirtilen türde bir tekil hizmet ekler.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Type ^ serviceType, Type ^ implementationType);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSingleton (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Type serviceType, Type implementationType);
static member AddSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * Type -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddSingleton (services As IServiceCollection, serviceType As Type, implementationType As Type) As IServiceCollection

Parametreler

services
IServiceCollection

IServiceCollection Hizmeti eklemek için.

serviceType
Type

Kaydedilecek hizmetin türü.

implementationType
Type

Hizmetin uygulama türü.

Döndürülenler

İşlem tamamlandıktan sonra bu örneğe başvuru.

Ayrıca bkz.

Şunlara uygulanır

AddSingleton(IServiceCollection, Type)

Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs

belirtilen serviceTypeIServiceCollectiontürüne tekil bir hizmet ekler.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Type ^ serviceType);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSingleton (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Type serviceType);
static member AddSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddSingleton (services As IServiceCollection, serviceType As Type) As IServiceCollection

Parametreler

services
IServiceCollection

IServiceCollection Hizmeti eklemek için.

serviceType
Type

Kaydedilecek hizmetin türü ve kullanılacak uygulama.

Döndürülenler

İşlem tamamlandıktan sonra bu örneğe başvuru.

Ayrıca bkz.

Şunlara uygulanır

AddSingleton(IServiceCollection, Type, Func<IServiceProvider,Object>)

Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs

içinde belirtilen fabrika ile belirtilen serviceType türde bir implementationFactoryIServiceCollectiontekil hizmet ekler.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Type ^ serviceType, Func<IServiceProvider ^, System::Object ^> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSingleton (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Type serviceType, Func<IServiceProvider,object> implementationFactory);
static member AddSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection * Type * Func<IServiceProvider, obj> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddSingleton (services As IServiceCollection, serviceType As Type, implementationFactory As Func(Of IServiceProvider, Object)) As IServiceCollection

Parametreler

services
IServiceCollection

IServiceCollection Hizmeti eklemek için.

serviceType
Type

Kaydedilecek hizmetin türü.

implementationFactory
Func<IServiceProvider,Object>

Hizmeti oluşturan fabrika.

Döndürülenler

İşlem tamamlandıktan sonra bu örneğe başvuru.

Ayrıca bkz.

Şunlara uygulanır

AddSingleton<TService,TImplementation>(IServiceCollection)

Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs

içinde belirtilen türde, içinde belirtilen TService uygulama türüyle TImplementation belirtilen IServiceCollectiontürde bir tekil hizmet ekler.

public:
generic <typename TService, typename TImplementation>
 where TService : class where TImplementation : class, TService[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSingleton<TService,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TService : class where TImplementation : class, TService;
static member AddSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddSingleton(Of TService As Class, TImplementation As Class) (services As IServiceCollection) As IServiceCollection

Tür Parametreleri

TService

Eklenecek hizmetin türü.

TImplementation

Kullanılacak uygulamanın türü.

Parametreler

services
IServiceCollection

IServiceCollection Hizmeti eklemek için.

Döndürülenler

İşlem tamamlandıktan sonra bu örneğe başvuru.

Ayrıca bkz.

Şunlara uygulanır

AddSingleton<TService,TImplementation>(IServiceCollection, Func<IServiceProvider,TImplementation>)

Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs

içinde belirtilen TService fabrikayı kullanarak implementationFactory belirtilen uygulama türüyle belirtilen IServiceCollectiontürde TImplementation bir tekil hizmet ekler.

public:
generic <typename TService, typename TImplementation>
 where TService : class where TImplementation : class, TService[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Func<IServiceProvider ^, TImplementation> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSingleton<TService,TImplementation> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Func<IServiceProvider,TImplementation> implementationFactory) where TService : class where TImplementation : class, TService;
static member AddSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<IServiceProvider, #'Service> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddSingleton(Of TService As Class, TImplementation As Class) (services As IServiceCollection, implementationFactory As Func(Of IServiceProvider, TImplementation)) As IServiceCollection

Tür Parametreleri

TService

Eklenecek hizmetin türü.

TImplementation

Kullanılacak uygulamanın türü.

Parametreler

services
IServiceCollection

IServiceCollection Hizmeti eklemek için.

implementationFactory
Func<IServiceProvider,TImplementation>

Hizmeti oluşturan fabrika.

Döndürülenler

İşlem tamamlandıktan sonra bu örneğe başvuru.

Ayrıca bkz.

Şunlara uygulanır

AddSingleton<TService>(IServiceCollection)

Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs

belirtilen TServiceIServiceCollectiontürüne tekil bir hizmet ekler.

public:
generic <typename TService>
 where TService : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSingleton<TService> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services) where TService : class;
static member AddSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddSingleton(Of TService As Class) (services As IServiceCollection) As IServiceCollection

Tür Parametreleri

TService

Eklenecek hizmetin türü.

Parametreler

services
IServiceCollection

IServiceCollection Hizmeti eklemek için.

Döndürülenler

İşlem tamamlandıktan sonra bu örneğe başvuru.

Ayrıca bkz.

Şunlara uygulanır

AddSingleton<TService>(IServiceCollection, Func<IServiceProvider,TService>)

Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs

içinde belirtilen fabrika ile belirtilen TService türde bir implementationFactoryIServiceCollectiontekil hizmet ekler.

public:
generic <typename TService>
 where TService : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Func<IServiceProvider ^, TService> ^ implementationFactory);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSingleton<TService> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Func<IServiceProvider,TService> implementationFactory) where TService : class;
static member AddSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<IServiceProvider, 'Service (requires 'Service : null)> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddSingleton(Of TService As Class) (services As IServiceCollection, implementationFactory As Func(Of IServiceProvider, TService)) As IServiceCollection

Tür Parametreleri

TService

Eklenecek hizmetin türü.

Parametreler

services
IServiceCollection

IServiceCollection Hizmeti eklemek için.

implementationFactory
Func<IServiceProvider,TService>

Hizmeti oluşturan fabrika.

Döndürülenler

İşlem tamamlandıktan sonra bu örneğe başvuru.

Ayrıca bkz.

Şunlara uygulanır

AddSingleton<TService>(IServiceCollection, TService)

Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs
Kaynak:
ServiceCollectionServiceExtensions.cs

içinde belirtilen TService türde bir tekil hizmet ekler ve belirtilen IServiceCollectionöğesine içinde belirtilen implementationInstance bir örnek ekler.

public:
generic <typename TService>
 where TService : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddSingleton(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, TService implementationInstance);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSingleton<TService> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, TService implementationInstance) where TService : class;
static member AddSingleton : Microsoft.Extensions.DependencyInjection.IServiceCollection * 'Service -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddSingleton(Of TService As Class) (services As IServiceCollection, implementationInstance As TService) As IServiceCollection

Tür Parametreleri

TService

Parametreler

services
IServiceCollection

IServiceCollection Hizmeti eklemek için.

implementationInstance
TService

Hizmetin örneği.

Döndürülenler

İşlem tamamlandıktan sonra bu örneğe başvuru.

Ayrıca bkz.

Şunlara uygulanır