public static void Add(ApplicationUser user, string password, [FromServices] MagelanDbContext dbContext) { PasswordHasher <ApplicationUser> hasher = new PasswordHasher <ApplicationUser>(); user.Id = Guid.NewGuid(); user.NormalizedEmail = user.Email.Normalize(); user.NormalizedUserName = user.UserName.Normalize(); user.PasswordHash = hasher.HashPassword(user, password); dbContext.ApplicationUsers.Add(user); dbContext.SaveChanges(); }
public virtual bool SaveChanges() { return(Context.SaveChanges() > 0); }