﻿using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;

namespace BrasilSincero.Core.BackgroundJob
{
    public static class BackgroundWorkerBuilderExtensions
    {
        public static BackgroundWorkerBuilder UseBackgroundJobs(this IApplicationBuilder app)
        {
            var worker = app.ApplicationServices.GetRequiredService<BackgroundWorker>();
            return new BackgroundWorkerBuilder(worker);
        }
    }
}