public async Task <byte[]> Generate(Guid notificationId) { using (var memoryStream = DocumentHelper.ReadDocumentStreamShared("InterimMovementMergeTemplate.docx")) { using (var document = WordprocessingDocument.Open(memoryStream, true)) { var notificationNumber = await notificationApplicationRepository.GetNumber(notificationId); MergeFieldLocator.MergeNamedField("NotificationNumber", notificationNumber, document); } return(memoryStream.ToArray()); } }