public ActionResult Create(NewUserPostModel model) { var usr = new User(model.Email, model.Password); var checkCreds = usr.Validate(); if (checkCreds.Succeeded) { Repo.Save(usr); return RedirectToAction("Edit", new { id = usr.ID }); } TempData.Add("ErrorMessage", checkCreds.Message); return RedirectToAction("New", model); }
public ActionResult New(NewUserPostModel model = null) { if (model == null) model = new NewUserPostModel(); return View(new User(){Email=model.Email}); }