Stashbox by Peter Csajtai

<PackageReference Include="Stashbox" Version="5.4.2-preview-759" />

 RegistrationConfigurator<TService, TImplementation>

public class RegistrationConfigurator<TService, TImplementation> : FluentServiceConfigurator<TService, TImplementation, RegistrationConfigurator<TService, TImplementation>> where TImplementation : TService
Represents the generic fluent service registration api.
using Stashbox.Lifetime; using Stashbox.Registration.ServiceRegistrations; using Stashbox.Utils; using System; using System.Runtime.CompilerServices; namespace Stashbox.Registration.Fluent { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1, 1, 1, 1, 1 })] public class RegistrationConfigurator<TService, TImplementation> : FluentServiceConfigurator<TService, TImplementation, RegistrationConfigurator<TService, TImplementation>> where TService : class where TImplementation : class, TService { internal RegistrationConfigurator(Type serviceType, Type implementationType, LifetimeDescriptor lifetimeDescriptor, [System.Runtime.CompilerServices.Nullable(2)] object name = null) : base(serviceType, implementationType, name, lifetimeDescriptor, false) { } public RegistrationConfigurator<TService, TImplementation> WithInstance(TService instance, bool wireUp = false) { Shield.EnsureNotNull<TService>(instance, "instance"); base.Registration = RegistrationFactory.EnsureInstance(instance, wireUp, base.Registration); return this; } } }