public async Task<StatusData<string>> SyncPhoneBook(PhoneBookContactsRequest request, SystemSession session) { var contacts = new UserMobileContacts { CTag = request.CTag, DeviceId = request.DeviceId, UserId = request.UserId, ToAddmobileContacts = request.Add.Select( x => new MobileContact { CountryCode = x.CountryCode, PrimaryContactNumber = x.MobileNumber.ToString() }).ToList(), ToDelmobileContacts = request.Delete.Select( x => new MobileContact { CountryCode = x.CountryCode, PrimaryContactNumber = x.MobileNumber.ToString() }).ToList(), Flush = request.Flush }; var result = new StatusData<string>(); var response = (await Task.Factory.StartNew(() => Client.UserService.contactSync(contacts, session.GetSession())).ConfigureAwait(false)); result.Status = (SystemDbStatus)response.SystemDbStatus; result.Data = response.CTag; result.Message = response.DbStatusMsg; return result; }
public void send_contactSync(UserMobileContacts userMobileContacts, Session session) #endif { oprot_.WriteMessageBegin(new TMessage("contactSync", TMessageType.Call, seqid_)); contactSync_args args = new contactSync_args(); args.UserMobileContacts = userMobileContacts; args.Session = session; args.Write(oprot_); oprot_.WriteMessageEnd(); #if SILVERLIGHT return oprot_.Transport.BeginFlush(callback, state); #else oprot_.Transport.Flush(); #endif }
public IAsyncResult send_contactSync(AsyncCallback callback, object state, UserMobileContacts userMobileContacts, Session session)
public UserMobileContacts contactSync(UserMobileContacts userMobileContacts, Session session) { #if !SILVERLIGHT send_contactSync(userMobileContacts, session); return recv_contactSync(); #else var asyncResult = Begin_contactSync(null, null, userMobileContacts, session); return End_contactSync(asyncResult); #endif }
public IAsyncResult Begin_contactSync(AsyncCallback callback, object state, UserMobileContacts userMobileContacts, Session session) { return send_contactSync(callback, state, userMobileContacts, session); }
public void Read (TProtocol iprot) { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 0: if (field.Type == TType.Struct) { Success = new UserMobileContacts(); Success.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 1: if (field.Type == TType.Struct) { Ex = new UserException(); Ex.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 2: if (field.Type == TType.Struct) { Se = new SessionException(); Se.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); }