Member group
TryAddTransient
Declaring type: ServiceCollectionExtensions
Module: Neo.DependencyInjection
Assembly: Neo.DependencyInjection.Abstractions.dll
Overloads / Variants
TryAddTransient
func TryAddTransient<TService, TImplementation>() -> Result<bool, ServiceError>
Extension from ServiceCollectionExtensions.TryAddTransient
Adds only when the service type/key is absent. Registers a transient service; invalid types or results are reported as ServiceError.
Parameters
| Name | Type | Description |
|---|---|---|
self |
ServiceCollection |
Return value
TryAddTransient
func TryAddTransient<TService>(factory: (ServiceProvider) -> Result<TService, ServiceError>) -> Result<bool, ServiceError>
Extension from ServiceCollectionExtensions.TryAddTransient
Adds only when the service type/key is absent. Registers a transient service; invalid types or results are reported as ServiceError.
Parameters
| Name | Type | Description |
|---|---|---|
self |
ServiceCollection | |
factory |
Function |
Return value
TryAddTransient
func TryAddTransient<TService>() -> Result<bool, ServiceError>
Extension from ServiceCollectionExtensions.TryAddTransient
Adds only when the service type/key is absent. Registers a transient service; invalid types or results are reported as ServiceError.
Parameters
| Name | Type | Description |
|---|---|---|
self |
ServiceCollection |