public async Task <IActionResult> Create([Bind("CourseId,name,description,department,number,semeseter,year, professor, professorEmail")] Course course)
        {
            if (ModelState.IsValid)
            {
                _context.Add(course);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(course));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("LearningOutcomeId,name,description,CourseNum")] LearningOutcome learningOutcome)
        {
            if (ModelState.IsValid)
            {
                _context.Add(learningOutcome);
                await _context.SaveChangesAsync();

                return(RedirectToAction("ByCourse", new { number = learningOutcome.CourseNum }));
            }
            return(View(learningOutcome));
        }