Method
AddFactory
func AddFactory(service: TypeInfo, factory: (ServiceProvider) -> Result<object, ServiceError>, lifetime: ServiceLifetime) -> Result<void, ServiceError>
Declaring type: DefaultServiceCollection
Module: Neo.DependencyInjection
Assembly: Neo.DependencyInjection.dll
Source file: Services.rvn
Implements ServiceCollection.AddFactory
Registers an unkeyed factory whose result becomes provider-owned.
Parameters
| Name | Type | Description |
|---|---|---|
service |
TypeInfo | |
factory |
Function | |
lifetime |
ServiceLifetime |
Return value
Result<void, ServiceError>