Ejemplo n.º 1
0
        public async Task <List <SearchUserDto> > SearchUserAsync(SearchUserDtoRequest request)
        {
            var currentUser = await _auth.FindByIdUserAsync(request.UserId);

            if (currentUser == null)
            {
                throw new UserNotExistException("Given user not exist!!", 400);
            }

            var users = (await _unit.UserRepository.SearchUsersAsync(request.Filter));

            users.Remove(currentUser);

            var res = _map.Map <List <SearchUserDto> >(users);

            return(res);
        }
Ejemplo n.º 2
0
        public async Task <List <SearchUserDto> > Search([FromQuery] SearchUserDtoRequest request)
        {
            request.UserId = (int)HttpContext.Items["id"];

            return(await this._userService.SearchUserAsync(request));
        }