コード例 #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;
        }
コード例 #2
0
     public UserSearchResult userSearch(UserSearchQuery query, Session session)
     {
 #if !SILVERLIGHT
         send_userSearch(query, session);
         return(recv_userSearch());
 #else
         var asyncResult = Begin_userSearch(null, null, query, session);
         return(End_userSearch(asyncResult));
 #endif
     }
コード例 #3
0
            public void send_userSearch(UserSearchQuery query, Session session)
      #endif
            {
                oprot_.WriteMessageBegin(new TMessage("userSearch", TMessageType.Call, seqid_));
                userSearch_args args = new userSearch_args();

                args.Query   = query;
                args.Session = session;
                args.Write(oprot_);
                oprot_.WriteMessageEnd();
        #if SILVERLIGHT
                return(oprot_.Transport.BeginFlush(callback, state));
        #else
                oprot_.Transport.Flush();
        #endif
            }
コード例 #4
0
            public void Read(TProtocol iprot)
            {
                TField field;

                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.Struct)
                        {
                            Query = new UserSearchQuery();
                            Query.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.Struct)
                        {
                            Session = new Session();
                            Session.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
コード例 #5
0
 public IAsyncResult send_userSearch(AsyncCallback callback, object state, UserSearchQuery query, Session session)
コード例 #6
0
 public IAsyncResult Begin_userSearch(AsyncCallback callback, object state, UserSearchQuery query, Session session)
 {
     return(send_userSearch(callback, state, query, session));
 }
コード例 #7
0
 public void send_userSearch(UserSearchQuery query, Session session)
 #endif
 {
   oprot_.WriteMessageBegin(new TMessage("userSearch", TMessageType.Call, seqid_));
   userSearch_args args = new userSearch_args();
   args.Query = query;
   args.Session = session;
   args.Write(oprot_);
   oprot_.WriteMessageEnd();
   #if SILVERLIGHT
   return oprot_.Transport.BeginFlush(callback, state);
   #else
   oprot_.Transport.Flush();
   #endif
 }
コード例 #8
0
 public IAsyncResult send_userSearch(AsyncCallback callback, object state, UserSearchQuery query, Session session)
コード例 #9
0
      public UserSearchResult userSearch(UserSearchQuery query, Session session)
      {
        #if !SILVERLIGHT
        send_userSearch(query, session);
        return recv_userSearch();

        #else
        var asyncResult = Begin_userSearch(null, null, query, session);
        return End_userSearch(asyncResult);

        #endif
      }
コード例 #10
0
 public IAsyncResult Begin_userSearch(AsyncCallback callback, object state, UserSearchQuery query, Session session)
 {
   return send_userSearch(callback, state, query, session);
 }
コード例 #11
0
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.Struct) {
           Query = new UserSearchQuery();
           Query.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Struct) {
           Session = new Session();
           Session.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }