public IActionResult Update(EditLearnOutcomeViewModel vm) { // Validate the model if (!ModelState.IsValid) { // Get the view model and return it return(View("Update", vm)); } //Add the question and answer to the learning outcome vm.LearningOutcome.QuestionAnswer.Add(context.ReadQuesAnswer(vm.QuestionId)); context.UpdateOutcome(vm.LearningOutcome.Id, vm.LearningOutcome); return(RedirectToAction("Index")); }