public virtual async Task <IActionResult> ExportXml() { if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageCategories)) { return(AccessDeniedView()); } try { var xml = await _exportManager.ExportCategoriesToXmlAsync(); return(File(Encoding.UTF8.GetBytes(xml), "application/xml", "categories.xml")); } catch (Exception exc) { await _notificationService.ErrorNotificationAsync(exc); return(RedirectToAction("List")); } }