namespace Umbraco.Core.Composing { /// /// Provides extension methods to the class. /// public static class RegisterExtensions { /// /// Registers a service with an implementation type. /// public static void Register(this IRegister register, Lifetime lifetime = Lifetime.Transient) => register.Register(typeof(TService), typeof(TImplementing), lifetime); /// /// Registers a service with an implementation type, for a target. /// public static void RegisterFor(this IRegister register, Lifetime lifetime = Lifetime.Transient) where TService : class => register.RegisterFor(typeof(TImplementing), lifetime); /// /// Registers a service as its own implementation. /// public static void Register(this IRegister register, Lifetime lifetime = Lifetime.Transient) where TService : class => register.Register(typeof(TService), lifetime); /// /// Registers a service with an implementing instance. /// public static void RegisterInstance(this IRegister register, TService instance) where TService : class => register.RegisterInstance(typeof(TService), instance); /// /// Registers a base type for auto-registration. /// public static void RegisterAuto(this IRegister register) where TServiceBase : class => register.RegisterAuto(typeof(TServiceBase)); } }