public FileContentResult ReportCsv(string orderStatus, DateTime?startDate, DateTime?endDate) { var orders = _orderQueryService.OrdersByStatus(orderStatus, startDate, endDate).OrderByDescending(o => o.UpdatedAt); var report = _orderReportService.Generate(orders); return(File(report, "text/csv", string.Format("orders-{0}.csv", DateTime.Now.ToString("yyyyMMdd-HHmmss")))); }