Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Cursus,School")] Subject subject)
        {
            if (ModelState.IsValid)
            {
                await _subjectManager.CreateAsync(subject);

                return(RedirectToAction("Index"));
            }

            ViewBag.Cursus = GetCursus();
            ViewBag.School = GetSchools();

            return(View(subject));
        }