Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

KeyedServiceExtensions.AddSingletonNamedService Method

Definition

Namespace:
Orleans.Runtime
Assembly:
Orleans.Core.dll
Package:
Microsoft.Orleans.Core v2.4.5
Package:
Microsoft.Orleans.Core v3.6.5
Package:
Microsoft.Orleans.Core v7.2.5

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

AddSingletonNamedService<TService,TInstance>(IServiceCollection, String)

Source:
KeyedService.cs

Register a singleton named service

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSingletonNamedService<TService,TInstance>(this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, string name) where TService : class where TInstance : class, TService;
static member AddSingletonNamedService : Microsoft.Extensions.DependencyInjection.IServiceCollection * string -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddSingletonNamedService(Of TService As Class, TInstance As Class) (collection As IServiceCollection, name As String) As IServiceCollection

Type Parameters

TService
TInstance

Parameters

collection
IServiceCollection
name
String

Returns

Applies to

AddSingletonNamedService<TService>(IServiceCollection, String, Func<IServiceProvider,String,TService>)

Source:
KeyedService.cs

Register a singleton named service

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSingletonNamedService<TService>(this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, string name, Func<IServiceProvider,string,TService> factory) where TService : class;
static member AddSingletonNamedService : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Func<IServiceProvider, string, 'Service (requires 'Service : null)> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddSingletonNamedService(Of TService As Class) (collection As IServiceCollection, name As String, factory As Func(Of IServiceProvider, String, TService)) As IServiceCollection

Type Parameters

TService

Parameters

collection
IServiceCollection
name
String
factory
Func<IServiceProvider,String,TService>

Returns

Applies to

AddSingletonNamedService<TService>(IServiceCollection, String, Type)

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddSingletonNamedService<TService>(this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, string name, Type implementationType) where TService : class;
static member AddSingletonNamedService : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Type -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Service : null)
<Extension()>
Public Function AddSingletonNamedService(Of TService As Class) (collection As IServiceCollection, name As String, implementationType As Type) As IServiceCollection

Type Parameters

TService

Parameters

collection
IServiceCollection
name
String
implementationType
Type

Returns

Applies to