public IActionResult SicSectionUploadCheckPost(AdminSicSectionUploadCheckViewModel viewModel) { var newRecords = JsonConvert.DeserializeObject <List <SicSection> >(viewModel.SerializedNewRecords); List <SicSection> sicSectionsFromDatabase = dataRepository.GetAll <SicSection>().ToList(); viewModel.AddsEditsDeletesSet = new AddsEditsDeletesSet <SicSection>( sicSectionsFromDatabase, newRecords, s => s.SicSectionId, (s1, s2) => s1.Description == s2.Description ); viewModel.ParseAndValidateParameters(Request, m => m.Reason); if (viewModel.HasAnyErrors()) { return(View("SicSectionUploadCheck", viewModel)); } List <SicSection> existingRecords = dataRepository.GetAll <SicSection>().ToList(); auditLogger.AuditGeneralAction(AuditedAction.AdminUpdatedSicSections, new { ExistingRecords = JsonConvert.SerializeObject(existingRecords.Select(GetSicSectionDetails)), NewRecords = JsonConvert.SerializeObject(newRecords.Select(GetSicSectionDetails)), Reason = viewModel.Reason }, User); SaveChangesToSicSections(viewModel); return(View("UploadConfirmation", FileUploadType.SicSection)); }