private async Task <List <ContactCandidate> > GetGraphContactsAsync() { var optionList = new List <QueryOption>(); var columns = "id,displayName,homePhones,mobilePhone,businessPhones"; optionList.Add(new QueryOption("$select", columns)); IUserContactsCollectionPage contacts; try { contacts = await this._graphClient.Me.Contacts.Request(optionList).GetAsync(); } catch (ServiceException ex) { throw GraphClient.HandleGraphAPIException(ex); } return(ToContactCandidates(contacts)); }
private async Task <List <ContactCandidate> > GetPeopleAsync() { var optionList = new List <QueryOption>(); var columns = "id,displayName,phones"; optionList.Add(new QueryOption("$select", columns)); IUserPeopleCollectionPage people; try { people = await this._graphClient.Me.People.Request(optionList).GetAsync(); } catch (ServiceException ex) { throw GraphClient.HandleGraphAPIException(ex); } return(ToContactCandidates(people)); }