Пример #1
0
        public UserDto CreateUser(string name, string username, string password, List <Role> roles)
        {
            string securityPassword = HashingPasswordHelper.ComputePasswordHashing(password);

            User user = userDb.CreateUser(name, username, securityPassword, roles);

            UserDto userDto = new UserDto()
            {
                Id       = user.Id,
                Name     = user.Name,
                Username = user.Username,
                Password = user.Password,
                Roles    = user.Roles,
                Payments = user.Payments
            };

            return(userDto);
        }