为什么 contact.DeleteAsync() 方法缺失/有错误?
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 ?
}
}
此行有错误: 等待 contact.DeleteAsync();
根据Contact Class的文档,没有可用的删除方法。您得到的行为是预期的。