Member group
AddKeyedScoped
Declaring type: ServiceCollectionExtensions
Module: Neo.DependencyInjection
Assembly: Neo.DependencyInjection.Abstractions.dll
Overloads / Variants
AddKeyedScoped
func AddKeyedScoped<TService, TImplementation>(key: object?) -> Result<void, ServiceError>
Extension from ServiceCollectionExtensions.AddKeyedScoped
Registers a keyed scoped implementation of TService.
Parameters
| Name | Type | Description |
|---|---|---|
self |
ServiceCollection | |
key |
Object? |
Return value
Result<void, ServiceError>
AddKeyedScoped
func AddKeyedScoped<TService>(key: object?, factory: (ServiceProvider, object?) -> Result<TService, ServiceError>) -> Result<void, ServiceError>
Extension from ServiceCollectionExtensions.AddKeyedScoped
Registers a keyed typed factory; its returned service becomes provider-owned.
Parameters
| Name | Type | Description |
|---|---|---|
self |
ServiceCollection | |
key |
Object? | |
factory |
Function |
Return value
Result<void, ServiceError>
AddKeyedScoped
func AddKeyedScoped<TService>(key: object?) -> Result<void, ServiceError>
Extension from ServiceCollectionExtensions.AddKeyedScoped
Registers TService as its own keyed scoped implementation.
Parameters
| Name | Type | Description |
|---|---|---|
self |
ServiceCollection | |
key |
Object? |
Return value
Result<void, ServiceError>