public async Task <IReadOnlyCollection <SummaryReport> > GetAllAsync() { IReadOnlyCollection <SummaryReport> summaryReports = _cache.GetAll(); if (summaryReports == null) { summaryReports = await _summaryReportRepository.GetAllAsync(); _cache.Initialize(summaryReports); } return(summaryReports); }
public async Task ApplyAsync() { IReadOnlyCollection <SummaryReport> summaryReports = await _summaryReportRepository.GetAllAsync(); _log.InfoWithDetails("Read summary reports", new { summaryReports.Count }); await _summaryReportRepository.DeleteAsync(); foreach (SummaryReport summaryReport in summaryReports) { summaryReport.TradeAssetPairId = summaryReport.AssetPairId; await _summaryReportRepository.InsertAsync(summaryReport); _log.InfoWithDetails("Updated summary report.", new { SummaryReport = summaryReport }); } }