public IActionResult Create(WebShout WebShout) { // gets the id of current logged in user from session var userId = LoggedInUserId(); WebShout.ApplicationUserId = (int)userId; dbContent.Add(WebShout); dbContent.SaveChanges(); return(RedirectToAction("Index")); }
public IActionResult Edit(WebShout webShout) { dbContent.Update(webShout); dbContent.SaveChanges(); return(RedirectToAction("Index")); }