public ActionResult Register(RegisterViewModel model) { if (ModelState.IsValid == false) return View(model); Person p = new Person() { Name = model.Name, Email = model.Email, Password = model.Password, IsActivated = false }; using (CrdbContext ctx = new CrdbContext()) { PersonBL.CreatePerson(p, ctx); } AppUser appUser = AppUser.FromPerson(p); IdentitySignin(appUser, null, model.RememberMe); if (string.IsNullOrEmpty(model.ReturnUrl)) model.ReturnUrl = Url.Action("Index", "Home"); return Redirect(model.ReturnUrl); }
public ActionResult Register() { RegisterViewModel model = new RegisterViewModel(); return View(model); }