Stashbox by Peter Csajtai

<PackageReference Include="Stashbox" Version="3.2.2" />

 RegistrationConfigurator

Represents the fluent service registration api.
using System; namespace Stashbox.Registration.Fluent { public class RegistrationConfigurator : FluentServiceConfigurator<RegistrationConfigurator> { internal RegistrationConfigurator(Type serviceType, Type implementationType) : base(serviceType, implementationType) { } public RegistrationConfigurator WithFactory(Func<IDependencyResolver, object> containerFactory, bool isCompiledLambda = false) { base.Context.ContainerFactory = containerFactory; base.Context.IsFactoryDelegateACompiledLambda = isCompiledLambda; return this; } public RegistrationConfigurator WithFactory(Func<object> singleFactory, bool isCompiledLambda = false) { base.Context.SingleFactory = singleFactory; base.Context.IsFactoryDelegateACompiledLambda = isCompiledLambda; return this; } public RegistrationConfigurator WithInstance(object instance, bool wireUp = false) { base.Context.ExistingInstance = instance; base.Context.IsWireUp = wireUp; base.ImplementationType = instance.GetType(); return this; } } }