我使用的是 Google Contacts API v3,无法更新联系人的性别信息
public static Contact UpdateContactName(ContactsRequest cr, Uri contactURL)
{
// First, retrieve the contact to update.
Contact contact = cr.Retrieve<Contact>(contactURL);
contact.Name.FullName = "New Name";
contact.Name.GivenName = "New";
contact.Name.FamilyName = "Name";
contact.ContactEntry.AddExtension(new Gender("male"));
try
{
Contact updatedContact = cr.Update(contact);
Console.WriteLine("Updated: " + updatedEntry.Updated.ToString())
return updatedContact;
}
catch (GDataVersionConflictException e)
{
// Etags mismatch: handle the exception.
}
return null;
}