Skip to content

Register services with ImplementationFactory #211

@LeonxPRO

Description

@LeonxPRO

Hello!
First, thanks for a Scrutor)
Is it any way for register services with ImplementationFactory, like in native IServiceCollectionmethod ?
AddSingleton<TService>(Func<IServiceProvider, TService> implementationFactory)
I imagine that like:

IServiceCollection collection = _serviceCollection.Scan(scan => scan.FromAssemblies(ass)
.AddClasses(classes => classes.AssignableTo<TService>(), false)
.AsImplementedInterfaces()
.WithSingletonLifetime(Func<IServiceProvider, TService> implementationFactory))

instead WithSingletonLifetime()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions