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

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

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

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

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