/// <summary> /// Registers the specified task lifetime type. /// Only the last registration will be used. /// </summary> /// <typeparam name="TLifetime">The type of the lifetime.</typeparam> /// <param name="services">The service registration collection.</param> /// <returns>The same <see cref="ICakeServices"/> instance so that multiple calls can be chained.</returns> public static ICakeServices UseTaskLifetime <TLifetime>(this ICakeServices services) where TLifetime : IFrostingTaskLifetime { Guard.ArgumentNotNull(services, nameof(services)); services.RegisterType <TLifetime>().As <IFrostingTaskLifetime>().Singleton(); return(services); }
/// <summary> /// Registers a specific tool for installation. /// </summary> /// <typeparam name="TPackageInstaller">The type of the package installer.</typeparam> /// <param name="services">The service registration collection.</param> /// <returns>The same <see cref="ICakeServices"/> instance so that multiple calls can be chained.</returns> public static ICakeServices UsePackageInstaller <TPackageInstaller>(this ICakeServices services) where TPackageInstaller : IPackageInstaller { Guard.ArgumentNotNull(services, nameof(services)); services.RegisterType <TPackageInstaller>().As <IPackageInstaller>().Singleton(); return(services); }
/// <summary> /// Registers the specified context type. /// Only the last registration will be used. /// </summary> /// <typeparam name="TContext">The type of the context to register.</typeparam> /// <param name="services">The service registration collection.</param> /// <returns>The same <see cref="ICakeServices"/> instance so that multiple calls can be chained.</returns> public static ICakeServices UseContext <TContext>(this ICakeServices services) where TContext : IFrostingContext { Guard.ArgumentNotNull(services, nameof(services)); services.RegisterType <TContext>().AsSelf().As <IFrostingContext>().Singleton(); return(services); }
public void Configure(ICakeServices services) { services.RegisterType <DummyStartupSentinel>(); }