示例#1
0
        public IActionResult Add(AddLearnOutcomeViewModel vm)
        {
            if (!ModelState.IsValid)
            {
                return(View("Add", vm));
            }

            if (!ModelState.IsValid)
            {
                return(View("Add", vm));
            }

            LearnOutcome Lo = new LearnOutcome
            {
                LearningOutcome = vm.LearningOutcome,
                QuestionAnswer  = new List <QuesAnswer>()
            };

            Lo.QuestionAnswer.Add(context.ReadQuesAnswer(vm.QuestionId));

            context.CreateLearningOutcome(Lo);
            return(RedirectToAction("Index"));
        }