Ejemplo n.º 1
0
 /// <summary>
 /// Update or create a set of contacts, this is the preferred method when creating/updating in bulk.
 /// Best performance is with a maximum of 250 contacts.
 /// </summary>
 /// <typeparam name="T">Implementation of ContactHubSpotModel</typeparam>
 /// <param name="contacts">The set of contacts to update/create</param>
 public Task BatchAsync(IEnumerable <ContactHubSpotModel> contacts, CancellationToken cancellationToken = default)
 {
     return(_client.ExecuteBatchAsync(GetRoute <ContactHubSpotModel>("contact", "batch"),
                                      contacts.Select(c => (object)new CreateOrUpdateContactBatchTransportModel(c)), Method.POST, cancellationToken));
 }