/// <summary> /// Gets the properties of the table service asynchronously. /// </summary> /// <param name="tableClient">Cloud table client.</param> /// <param name="cancellationToken">Cancellation token.</param> /// <returns>Task.</returns> public static Task <ServiceProperties> GetServicePropertiesAsync( this CloudTableClient tableClient, CancellationToken cancellationToken = default(CancellationToken)) { ICancellableAsyncResult asyncResult = tableClient.BeginGetServiceProperties(null, null); CancellationTokenRegistration registration = cancellationToken.Register(p => asyncResult.Cancel(), null); return(Task <ServiceProperties> .Factory.FromAsync( asyncResult, result => { registration.Dispose(); return tableClient.EndGetServiceProperties(result); })); }
public ServiceProperties EndGetServiceProperties(IAsyncResult asyncResult) { return(_cloudTableClient.EndGetServiceProperties(asyncResult)); }