public async Task <IActionResult> Export() { using (var memoryStream = new MemoryStream()) { using (var zip = new ZipArchive(memoryStream, ZipArchiveMode.Create)) { await WriteInFile(zip, "Posts.json", _context.GetAllPosts()); await WriteInFile(zip, "Visitations.json", _context.GetAllVisitations()); await WriteInFile(zip, "Symptoms.json", _context.GetAllSymptoms()); } return(File(memoryStream.ToArray(), "application/json; charset=UTF-8", "Import.zip")); } }