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

API Browser

Method

AddKeyedInstance

abstract virtual func AddKeyedInstance(service: TypeInfo, key: object?, instance: object) -> Result<void, ServiceError>

Declaring type: ServiceCollection
Module: Neo.DependencyInjection
Assembly: Neo.DependencyInjection.Abstractions.dll
Source file: Services.rvn

Defined by ServiceCollection.AddKeyedInstance · Required implementation (no default).

Interface implementation: Required implementation (no default).

Registers a caller-owned instance for an exact type/key pair.

Parameters

Name Type Description
service TypeInfo
key Object?
instance Object

Return value

Result<void, ServiceError>