using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Netina.Core.QuartzServices;

namespace Netina.Core;
public static class CoreConfig
{

    public static async Task CoreInit(this IApplicationBuilder app)
    {
        var scopeFactory = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>();
        using (var scope = scopeFactory.CreateScope())
        {
            var jobScheduler = scope.ServiceProvider.GetService<JobScheduler>();
            jobScheduler.Start();
        }
    }
}

