Esempio n. 1
0
        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();
        }
Esempio n. 2
0
 public virtual bool SaveChanges()
 {
     return(Context.SaveChanges() > 0);
 }