When I try to delete a contact, stored in some group with

_contactGroupServices.BeginDeleteContact -> _contactGroupServices.EndDeleteContact

it's deleting from each group in contact list.

Is it possible to delete this contact only from one selected group?

有帮助吗?

解决方案

Use the ContactGroupServices.BeginUpdateContact method (and the corresponding EndUpdateContact).

This method takes a Contact parameter, which in turn has a collection of group numbers called GroupIds.

The workflow would be:

  1. Get the GroupId of the group you want to remove the contact from.
  2. Get the Contact entry you want to remove from the group.
  3. Remove the GroupId from his collection of GroupIds.
  4. Call BeginUpdateContact with the new contact details.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top