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)); }
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; } }