public async Task<PaginatedResponseExtended<IEnumerable<UserInformationBaseExtendedResponse>, int>> GetMutualFriends(PaginatedRequest<string> request, SystemSession session)
        {
            var serviceRequest = new MutualFriend
            {
                UserId = session.UserId,
                TargetType = "F",
                TargetUser = request.Data,
                PageIndex = request.PageIndex,
                PageSize = request.PageSize
            };

            var data = await Task.Factory.StartNew(() => Client.UserService.getMutualFriends(serviceRequest, session.GetSession())).ConfigureAwait(false);
            var result = new PaginatedResponseExtended<IEnumerable<UserInformationBaseExtendedResponse>, int>
            {
                Page = data.MutualFriends.Select(x => new UserInformationBaseExtendedResponse
                {
                    UserId = x.UserId,
                    UserName = x.UserName,
                    UserTypeId = (SystemUserType)x.UserTypeId,
                    FirstName = x.FirstName,
                    LastName = x.LastName,
                    Image = x.Picture,
                    Title = x.Title
                }),
                HasNextPage = data.HasNextPage,
                Information = data.Count
            };

            return result;
        }
 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.List) {
           {
             MutualFriends = new List<MutualFriend>();
             TList _list136 = iprot.ReadListBegin();
             for( int _i137 = 0; _i137 < _list136.Count; ++_i137)
             {
               MutualFriend _elem138;
               _elem138 = new MutualFriend();
               _elem138.Read(iprot);
               MutualFriends.Add(_elem138);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Bool) {
           HasNextPage = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.I32) {
           Count = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
Esempio n. 3
0
 public void send_getMutualFriends(MutualFriend mf, Session session)
 #endif
 {
   oprot_.WriteMessageBegin(new TMessage("getMutualFriends", TMessageType.Call, seqid_));
   getMutualFriends_args args = new getMutualFriends_args();
   args.Mf = mf;
   args.Session = session;
   args.Write(oprot_);
   oprot_.WriteMessageEnd();
   #if SILVERLIGHT
   return oprot_.Transport.BeginFlush(callback, state);
   #else
   oprot_.Transport.Flush();
   #endif
 }
Esempio n. 4
0
 public IAsyncResult send_getMutualFriends(AsyncCallback callback, object state, MutualFriend mf, Session session)
Esempio n. 5
0
      public MutualFriendResponse getMutualFriends(MutualFriend mf, Session session)
      {
        #if !SILVERLIGHT
        send_getMutualFriends(mf, session);
        return recv_getMutualFriends();

        #else
        var asyncResult = Begin_getMutualFriends(null, null, mf, session);
        return End_getMutualFriends(asyncResult);

        #endif
      }
Esempio n. 6
0
 public IAsyncResult Begin_getMutualFriends(AsyncCallback callback, object state, MutualFriend mf, Session session)
 {
   return send_getMutualFriends(callback, state, mf, session);
 }
Esempio n. 7
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) {
           Mf = new MutualFriend();
           Mf.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();
 }
Esempio n. 8
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.List)
                    {
                        {
                            MutualFriends = new List <MutualFriend>();
                            TList _list136 = iprot.ReadListBegin();
                            for (int _i137 = 0; _i137 < _list136.Count; ++_i137)
                            {
                                MutualFriend _elem138;
                                _elem138 = new MutualFriend();
                                _elem138.Read(iprot);
                                MutualFriends.Add(_elem138);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Bool)
                    {
                        HasNextPage = iprot.ReadBool();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.I32)
                    {
                        Count = iprot.ReadI32();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }