public async Task <ActionResult> GenerateMasterSideLetter([FromQuery] int fundId, string fundInvestorIds) { if (!string.IsNullOrEmpty(fundInvestorIds)) { var fundInvestorIdList = fundInvestorIds.Split(',').Select(x => Convert.ToInt32(x)).ToList(); using (var dataAccess = new MasterSideLetterDataAccess(_connectionStrings.MasterSideLetterDb)) { var searchSettings = await dataAccess.GetSearchSettingsAsync(); var masterSideLetter = await dataAccess.GenerateMasterSideLetterContentAsync(fundId, fundInvestorIdList); var mem = DocumentHelper.GenerateMasterSideLetterDocument(searchSettings, masterSideLetter); return(File(mem.ToArray(), "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "MasterSideLetter.docm")); } } return(null); }