public async Task <byte[]> ExportUsersTable(ExportFormat format, OrderingRequestModel <UserTableColumn, SortingDirection> order) { var users = await GetUsers(order); byte[] resultBytes = null; switch (format) { case ExportFormat.Pdf: var html = await _htmlTableConverter.CreateHtmlTable("wwwroot/HtmlContentTemplates/HtmlLayout.html", "CONTENT", users.ToList(), "Users list"); resultBytes = await _pdfService.GetPdfFromHtml(html, DocumentOrientation.Horizontal); break; case ExportFormat.Xls: resultBytes = await _xlsService.GetXlsList(users, "Users list"); break; } return(resultBytes); }