public ActionResult Create(IFormCollection collection, Models.User user) { PizzaBox.Domain.User dmu = new User(); dmu.Userid = user.Userid; dmu.Username = user.Username; dmu.Password = user.Password; dmu.Firstname = user.Firstname; dmu.Lastname = user.Lastname; //dmu.Ulocationid = user.Ulocationid; dmu.Ulocationid = (int)TempData["Locationid"]; try { // TODO: Add insert logic here db.AddUser(dmu); db.Save(); return(RedirectToAction(nameof(UsersPage), new { lid = dmu.Ulocationid })); } catch { return(View()); } }