elsa-core/src/modules/retention/Elsa.Retention/Extensions/ServiceCollectionExtensions.cs

21 lines
607 B
C#
Raw Normal View History

2021-09-27 11:55:24 +00:00
using System;
using Elsa.Retention.HostedServices;
using Elsa.Retention.Jobs;
using Elsa.Retention.Options;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Retention.Extensions
{
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddRetentionServices(this IServiceCollection services, Action<CleanupOptions> configureOptions)
{
services
.Configure(configureOptions)
.AddScoped<CleanupJob>()
.AddHostedService<CleanupService>();
return services;
}
}
}