public async Task <UserDto> GetByCredentials(string username, string password)
        {
            var user = await _userRepository.GetByCredentials(username, password);

            return(UserRolesFactoryMapper.MapToDto(user));
        }
        public async Task <UserDto> GetById(int userId)
        {
            var user = await _userRepository.GetByIdAsync(userId);

            return(UserRolesFactoryMapper.MapToDtoWithPassword(user));
        }
        public async Task <int> Update(UserDto user)
        {
            var entity = UserRolesFactoryMapper.MapToEntity(user);

            return(await _userRepository.Update(entity));
        }
        public async Task <IEnumerable <UserDto> > GetAllUsersAsync()
        {
            var userList = await _userRepository.GetAllUsersAsync();

            return(UserRolesFactoryMapper.MapToDto(userList.ToList()));
        }