Domanda

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?

È stato utile?

Soluzione

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.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top