Пример #1
0
        public async Task <TLLink> DeleteContactAsync(TLAbsInputUser user, CancellationToken token = default(CancellationToken))
        {
            var req = new TLRequestDeleteContact {
                Id = user
            };

            return(await SendAuthenticatedRequestAsync <TLLink>(req, token)
                   .ConfigureAwait(false));
        }
Пример #2
0
 public bool DeleteContact(TLClient client, Contact contact, ContactRepository contactRepository)
 {
     try
     {
         TLRequestDeleteContact req = new TLRequestDeleteContact
         {
             Id = new TLInputUser
             {
                 UserId     = contact.Id,
                 AccessHash = contact.AccessHash
             }
         };
         var result = Task.Run(() => client.SendRequestAsync <object>(req));
         result.Wait();
         contactRepository.DeleteContact(contact);
         return(true);
     }
     catch (Exception ex)
     {
         throw;
     }
 }