예제 #1
0
 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);
 }
예제 #2
0
 public ActionResult New(NewUserPostModel model = null)
 {
     if (model == null) model = new NewUserPostModel();
     return View(new User(){Email=model.Email});
 }