private static async Task AddAsync <TReport>( MutableReport report, IConsistencyService <TReport> service, Action <MutableReport, TReport> addPartialReport, string message) where TReport : IConsistencyReport { var min = (report.Processed + 0) / (decimal)report.Total; var max = (report.Processed + 1) / (decimal)report.Total; var childReport = await service.GetReportAsync( report.Context, report.State, new PartialProgressReporter(report.ProgressReporter, min, max)); report.Processed++; addPartialReport(report, childReport); report.IsConsistent &= childReport.IsConsistent; await report.ProgressReporter.ReportProgressAsync(max, message); }