public CfContactQueryResult QueryContacts(CfQueryContacts queryContacts) { var resourceList = BaseRequest <ResourceList>(HttpMethod.Get, new QueryContacts(queryContacts), new CallfireRestRoute <Contact>()); var contact = resourceList.Resource == null ? null : resourceList.Resource.Select(r => ContactMapper.FromContact((Contact)r)).ToArray(); return(new CfContactQueryResult(resourceList.TotalResults, contact)); }
public CfContactSource(object[] items) { if (items != null && items.Any()) { if (items.GetValue(0).GetType() == typeof(Contact)) { Items = items.Select(i => ContactMapper.FromContact(i as Contact)).ToArray(); } else if (items.GetValue(0).GetType() == typeof(ContactSourceNumbers)) { Items = items.Select(i => ContactSourceNumbersMapper.FromContactSourceNumbers(i as ContactSourceNumbers)).ToArray(); } else { Items = items; } } }
public CfContact GetContact(long id) { return(ContactMapper.FromContact(ContactService.GetContact(new IdRequest(id)))); }
public CfContact GetContact(long id) { var resource = BaseRequest <Resource>(HttpMethod.Get, null, new CallfireRestRoute <Contact>(id)); return(ContactMapper.FromContact(resource.Resources as Contact)); }