using AsbCloudApp.Data.SAUB; using AsbCloudApp.Data.WITS; using AsbCloudApp.Repositories; using AsbCloudApp.Requests; using AsbCloudApp.Services; using System.Threading; using System.Threading.Tasks; namespace AsbCloudInfrastructure.Services.SAUB; /// /// Сервис по работе с данными телеметрии /// public class TelemetryDataEditorService : ITelemetryDataEditorService { private readonly ITelemetryDataEditorService[] repositories; /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// public TelemetryDataEditorService( ITelemetryDataSaubService dataSaubService, ITelemetryDataService dataSpinService, IDataSaubStatRepository dataSaubStatRepository, IMessageService messageService, IDrillTestRepository drillTestRepository, ILimitingParameterRepository limitingParameterRepository, IDetectedOperationRepository detectedOperationRepository, IWitsRecordRepository witsRecord1Repository, IWitsRecordRepository witsRecord7Repository, IWitsRecordRepository witsRecord8Repository, IWitsRecordRepository witsRecord50Repository, IWitsRecordRepository witsRecord60Repository, IWitsRecordRepository witsRecord61Repository, IGtrRepository gtrRepository ) { repositories = [ dataSaubService, dataSpinService, dataSaubStatRepository, messageService, drillTestRepository, limitingParameterRepository, detectedOperationRepository, witsRecord1Repository, witsRecord7Repository, witsRecord8Repository, witsRecord50Repository, witsRecord60Repository, witsRecord61Repository, gtrRepository, ]; } public async Task DeleteAsync(TelemetryPartDeleteRequest request, CancellationToken token) { var result = 0; foreach (var repository in repositories) { result += await repository.DeleteAsync(request, token); } return result; } }