This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task<bool> Delete(string strContactId) | |
{ | |
bool bStatus = false; | |
//query the contact by contact Id | |
//GetById is broken so you need to use this instead | |
var contact = await _exchangeClient.Me.Contacts[strContactId].ExecuteAsync(); | |
if (contact != null) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task<bool> Update(MyContact myContact) | |
{ | |
bool bStatus = false; | |
//myContact is my business object | |
//query the contact by contact Id | |
//GetById is broken so you need to use this instead | |
var contact = await _exchangeClient.Me.Contacts[myContact.Id].ExecuteAsync(); | |
if (contact != null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task<byte[]> GetContactImage(string strContactId) | |
{ | |
byte[] bytesContactPhoto = new byte[0]; | |
//query the contact by contact Id | |
//GetById is broken so you need to use this instead | |
var contact = await _exchangeClient.Me.Contacts[strContactId].ExecuteAsync(); | |
if (contact != null) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task<ObservableCollection<MyContact>> GetContacts() | |
{ | |
ObservableCollection<MyContact> myContactList = new ObservableCollection<MyContact>(); | |
//query contacts | |
var contactsResults = await _exchangeClient.Me.Contacts.OrderBy(c=>c.DisplayName).ExecuteAsync(); | |
//fetches the first 50 contacts | |
//default page count is 50 | |
var contacts = contactsResults.CurrentPage.ToList(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static async Task Create(MyContact myContact) | |
{ | |
//create the Exchange contact | |
IContact contact = new Contact(); | |
contact.GivenName = myContact.Name; | |
contact.DisplayName = myContact.Name; | |
contact.EmailAddress1 = myContact.Email; | |
contact.JobTitle = myContact.JobTitle; | |
//add the contact |
NewerOlder