using AsbCloudApp.Requests; using AsbCloudApp.Services; using Microsoft.Extensions.DependencyInjection; using System; using System.Threading; using System.Threading.Tasks; namespace AsbCloudInfrastructure.Background { /// /// Класс для создания отчета /// internal class WorkToCreateReport : Work { private int idWell; private int idUser; private ReportParametersRequest request; private Action progressHandler; public WorkToCreateReport(int idWell, int idUser, ReportParametersRequest request, Action progressHandler) : base("") { this.idWell = idWell; this.idUser = idUser; this.request = request; this.progressHandler = progressHandler; } protected override async Task Action(string id, IServiceProvider services, Action onProgress, CancellationToken token) { var reportService = services.GetRequiredService(); await reportService.CreateReportAsync(idWell, idUser, request, progressHandler, token); } } }