public void Delete(ContactEntry c) { using (PoolItem <ContactsService> connection = this.contactsServicePool.Take()) { ApiExtensions.InvokeWithRateLimit(() => connection.Item.Delete(c), this.serviceName); } }
public ContactEntry GetContact(string id) { using (PoolItem <ContactsService> connection = this.contactsServicePool.Take()) { return(ApiExtensions.InvokeWithRateLimit(() => (ContactEntry)connection.Item.Get(id), this.serviceName)); } }
public void Delete(string id) { using (PoolItem <ContactsService> connection = this.contactsServicePool.Take()) { ContactEntry e = ApiExtensions.InvokeWithRateLimit(() => (ContactEntry)connection.Item.Get(id), this.serviceName); this.Delete(e); } }
public IEnumerable <ContactEntry> GetContacts(string domain) { using (PoolItem <ContactsService> connection = this.contactsServicePool.Take()) { string uri = ContactsQuery.CreateContactsUri(domain); do { ContactsQuery request = new ContactsQuery(uri) { NumberToRetrieve = 1000 }; ContactsFeed result = ApiExtensions.InvokeWithRateLimit(() => connection.Item.Query(request), this.serviceName); foreach (ContactEntry entry in result.Entries.OfType <ContactEntry>()) { yield return(entry); } uri = result.NextChunk; } while (uri != null); } }