public ActionResult Create(MajorViewModel majorViewModel)
        {
            if (ModelState.IsValid)
            {
                _majorService.Create(majorViewModel);
                return(RedirectToAction("Index", new { UserId = majorViewModel.UserId }));
            }

            return(View());
        }
Beispiel #2
0
 public IActionResult Post([FromBody] Major major)
 {
     majorService.Create(major);
     return(Created("", major));
 }