public async Task <ReportDownloadViewModel> GetDownloadCsvAsync(long ukprn, Guid reportId) { var report = await GetReportAsync(ukprn, reportId); var stream = new MemoryStream(); _vacancyClient.WriteReportAsCsv(stream, report); await _vacancyClient.IncrementReportDownloadCountAsync(report.Id); return(new ReportDownloadViewModel { Content = stream, ReportName = report.ReportName }); }