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

API Browser

Method

AddKeyedFactory

abstract virtual func AddKeyedFactory(service: TypeInfo, key: object?, factory: (ServiceProvider, object?) -> Result<object, ServiceError>, lifetime: ServiceLifetime) -> Result<void, ServiceError>

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

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

Interface implementation: Required implementation (no default).

Registers a factory receiving the current provider and the registration key.

Parameters

Name Type Description
service TypeInfo
key Object?
factory Function
lifetime ServiceLifetime

Return value

Result<void, ServiceError>