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

API Browser

Method

AddFactory

abstract virtual func AddFactory(service: TypeInfo, factory: (ServiceProvider) -> 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.AddFactory · Required implementation (no default).

Interface implementation: Required implementation (no default).

Registers a factory whose non-null result is validated and owned by its resolving provider.

Parameters

Name Type Description
service TypeInfo
factory Function
lifetime ServiceLifetime

Return value

Result<void, ServiceError>