How to delete Contact in Windows 10 UWP, contact.DeleteAsync() METHOD IS MISSING

58 Views Asked by At

why contact.DeleteAsync() METHOD IS MISSING / with ERROR?

private static async Task DoContactDelete()
        {
var contactStore = await ContactManager.RequestStoreAsync(ContactStoreAccessType.AllContactsReadOnly);
            var contacts = await contactStore.FindContactsAsync();
            
            foreach (var contact in contacts) {
             var Text = contact.ToString();
             // ONLY THIS ONE METHOD AVAILABLE, contact.DeleteAsync() METHOD IS MISSING

        await contact.DeleteAsync();
// Error   CS1061  'Contact' does not contain a definition for
 'DeleteAsync' and no accessible extension method 'DeleteAsync' 
//accepting a first argument of type 'Contact' could be found
(are you missing a using directive or an assembly reference ?
            }
        }

This line is with Error:

await contact.DeleteAsync();
1

There are 1 best solutions below

2
Roy Li - MSFT On

Based on the document for the Contact Class, there is no Delete method available. The behavior you get is expected.