/// <param name='operations'> /// Reference to the ContactsConsoleApplication.IContacts. /// </param> /// <param name='contact'> /// Required. /// </param> public static string PostByContact(this IContacts operations, Contact contact) { return Task.Factory.StartNew((object s) => { return ((IContacts)s).PostByContactAsync(contact); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <param name='operations'> /// Reference to the ContactsConsoleApplication.IContacts. /// </param> /// <param name='contact'> /// Required. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> public static async Task<string> PostByContactAsync(this IContacts operations, Contact contact, CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Microsoft.Rest.HttpOperationResponse<string> result = await operations.PostByContactWithOperationResponseAsync(contact, cancellationToken).ConfigureAwait(false); return result.Body; }