Ejemplo n.º 1
0
        private async Task <User> CheckUserAsync(string firstName, string lastName, string email,
                                                 string phone, string rol)
        {
            var user = await uh.GetUserByEMailAsync(email);

            if (user == null)
            {
                user = new User
                {
                    FullName    = firstName + " " + lastName,
                    Email       = email,
                    UserName    = email,
                    PhoneNumber = phone,
                };

                await uh.AddUserAssync(user, "admin1234");

                await uh.AddUserToRoleAsync(user, rol);
            }
            return(user);
        }