Skip to content

Instantly share code, notes, and snippets.

@Mirch Mirch/RegisterMethods.cs
Last active Sep 30, 2018

What would you like to do?
public IActionResult Register()
return View();
public async Task<IActionResult> Register(UserRegisterModel model)
var exists = _db.Users.SingleOrDefault(u => u.Email.Equals(model.Username));
if (exists != null)
return View();
var result = await _userManager.CreateAsync(new IdentityUser(model.Username), model.Password);
if (result.Succeeded)
return RedirectToAction("Index", "Home");
return View();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.