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

API Browser

Method

AddKeyedFactory

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

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

Implements ServiceCollection.AddKeyedFactory

Registers a factory receiving its key; the result becomes provider-owned.

Parameters

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

Return value

Result<void, ServiceError>