Exemplo n.º 1
0
        public List <ContactLookupRow> ContactLookup(int accountId, ContactLookupOptions options, out int count)
        {
            var request  = TDClient.BuildRequest(Method.POST, CONTACT_LOOKUP, new { accountId }, options);
            var response = TDClient.InnerExecute(request);

            if (response.StatusCode == HttpStatusCode.NoContent)
            {
                count = 0;
                return(new List <ContactLookupRow>());
            }

            var rval        = response.Deserialize <List <ContactLookupRow> >();
            var countHeader = response.Headers.FirstOrDefault(p => p.Name == "X-TrueDialog-Count");

            count = countHeader != null?int.Parse(countHeader.Value.ToString()) : rval.Count;

            return(rval);
        }
Exemplo n.º 2
0
 public List <ContactLookupRow> ContactLookup(ContactLookupOptions options, out int count)
 {
     return(ContactLookup(CurrentAccount, options, out count));
 }
Exemplo n.º 3
0
 public List <ContactLookupRow> ContactLookup(int accountId, ContactLookupOptions options, out int count)
 {
     /* TODO: review option to return enveloped response */
     count = options.Take + 1;
     return(Api.Post <List <ContactLookupRow> >($"/account/{accountId}/contactLookup", options));
 }