Ejemplo n.º 1
0
        public async Task<UserSearchResponse> UserSearch(UserSearchRequest request, SystemSession session)
        {
            var serviceRequest = new UserSearchQuery
            {
                Query = request.Query,
                Cursor = request.Cursor,
                Limit = request.Limit
            };

            var response = await Task.Factory.StartNew(() => Client.SearchService.userSearch(serviceRequest, session.GetSession())).ConfigureAwait(false);

            var result = new UserSearchResponse
            {
                Cursor = response.Cursor,
                Limit = response.Limit,
                Count = response.Count,

                User = response.Users != null ? response.Users.Select(x => new UserInformationBaseExtendedResponse
                {
                    FirstName = x.UserInfoPerson.FirstName,
                    LastName = x.UserInfoPerson.LastName,
                    Image = x.UserInfo.Picture,
                    Title = x.UserInfo.Title,
                    UserId = Convert.ToInt32(x.UserInfoPerson.UserId),
                    UserName = x.UserName,
                    UserTypeId = (SystemUserType)x.UserInfo.UserTypeId
                }) : null
            };
            return result;
        }
Ejemplo n.º 2
0
 public async Task<HttpResponseMessage> Search(UserSearchRequest request)
 {
     var response = new StatusData<UserSearchResponse> { Status = SystemDbStatus.Selected, Data = await _service.UserSearch(request, Request.GetSession()).ConfigureAwait(false) };
     return Request.SystemResponse(response);
 }
Ejemplo n.º 3
0
 public Task<UserSearchResponse> UserSearch(UserSearchRequest request, SystemSession session)
 {
     return _jUnitOfWork.Search.UserSearch(request, session);
 }