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

API Browser

Method

AddInstance

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

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

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

Interface implementation: Required implementation (no default).

Registers an assignable caller-owned instance; provider disposal never disposes this registration.

Parameters

Name Type Description
service TypeInfo
instance Object

Return value

Result<void, ServiceError>