Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

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

Return value

Result<Boolean, ServiceError>