public ActionResult Create(User user) { userBll.CreateUser(user); try { activeUser = userBll.GetUserById((long)HttpContext.Session.GetInt32("userId")); if (activeUser.Administrator > 0) { //userBll.CreateUser(user); } return(RedirectToAction(nameof(Index))); } catch { ViewData["sessionData"] = new int?[] { HttpContext.Session.GetInt32("admin"), HttpContext.Session.GetInt32("language") }; return(View()); } }
//implementatie REST protocol voor met de JSON code langs front-end overweg te kunnen [FromBody] //Het [FromBody] attribuut zal gebruikt worden om het content type te bepalen public void Post([FromBody] User user) { userBll.CreateUser(user); }
public void Post([FromBody] User user) { userBll.CreateUser(user); //userProcessor.Create(user); }