Ejemplo n.º 1
0
        public async Task <User> CreateNewUserAsync(IdentityUser user)
        {
            var role = await _roleRepository.GetByUserRole(UserRole.USER);

            return(await _userRepository.AddAsync(new User
            {
                FirstName = user.FirstName,
                LastName = user.LastName,
                Email = user.Login,
                Role = role,
                RoleId = role.Id,
                Password = user.Password
            }));
        }