Member group
AddKeyedTransient
Declaring type: ServiceCollectionExtensions
Module: Neo.DependencyInjection
Assembly: Neo.DependencyInjection.Abstractions.dll
Overloads / Variants
AddKeyedTransient
func AddKeyedTransient<TService, TImplementation>(key: object?) -> Result<void, ServiceError>
Extension from ServiceCollectionExtensions.AddKeyedTransient
Registers a keyed transient implementation of TService.
Parameters
| Name | Type | Description |
|---|---|---|
self |
ServiceCollection | |
key |
Object? |
Return value
Result<void, ServiceError>
AddKeyedTransient
func AddKeyedTransient<TService>(key: object?, factory: (ServiceProvider, object?) -> Result<TService, ServiceError>) -> Result<void, ServiceError>
Extension from ServiceCollectionExtensions.AddKeyedTransient
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>
AddKeyedTransient
func AddKeyedTransient<TService>(key: object?) -> Result<void, ServiceError>
Extension from ServiceCollectionExtensions.AddKeyedTransient
Registers TService as its own keyed transient implementation.
Parameters
| Name | Type | Description |
|---|---|---|
self |
ServiceCollection | |
key |
Object? |
Return value
Result<void, ServiceError>