public async Task <FileData> HandleAsync(GenerateNotificationDocument query) { var docxBytes = await notificationDocumentGenerator.GenerateNotificationDocument(query.NotificationId); var fileName = string.Format("IWS-Notification-{0}-{1}", query.NotificationId, SystemTime.UtcNow); if (pdfGenerator != null) { var pdfBytes = pdfGenerator.ConvertToPdf(docxBytes); return(new FileData(fileName, FileType.Pdf, pdfBytes)); } return(new FileData(fileName, FileType.Docx, docxBytes)); }
public async Task <FileData> HandleAsync(GenerateMovementDocument message) { var docxBytes = await documentGenerator.Generate(message.Id); var fileName = string.Format("IWS-Movement-{0}-{1}", message.Id, SystemTime.UtcNow); if (pdfGenerator != null) { var pdfBytes = pdfGenerator.ConvertToPdf(docxBytes); return(new FileData(fileName, FileType.Pdf, pdfBytes)); } return(new FileData(fileName, FileType.Docx, docxBytes)); }