Esempio n. 1
0
        private async Task <User> CheckUserAsync(string firstname, string lastname, string email, string phone, string rol)
        {
            var user = await _userHelper.GetUserByEmailAsync(email);

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

                await _userHelper.AddUserAsync(user, "admin1234");

                await _userHelper.AddUserToRole(user, rol);
            }
            return(user);
        }