Method
TryAdd
abstract virtual func TryAdd(descriptor: ServiceDescriptor) -> Result<bool, ServiceError>
Declaring type: ServiceCollection
Module: Neo.DependencyInjection
Assembly: Neo.DependencyInjection.Abstractions.dll
Source file: Services.rvn
Defined by ServiceCollection.TryAdd · Required implementation (no default).
Interface implementation: Required implementation (no default).
Adds only if the exact service type/key is absent; never invokes factories.
Parameters
| Name | Type | Description |
|---|---|---|
descriptor |
ServiceDescriptor |