public virtual Response <TableItem> Create(CancellationToken cancellationToken = default) { var response = _tableOperations.Create(new TableProperties(_table), null, queryOptions: new QueryOptions() { Format = _format }, cancellationToken: cancellationToken); return(Response.FromValue(response.Value as TableItem, response.GetRawResponse())); }
/// <summary> /// Creates a table on the service. /// </summary> /// <param name="tableName">The name of table to create.</param> /// <param name="cancellationToken">A <see cref="CancellationToken"/> controlling the request lifetime.</param> /// <returns>A <see cref="Response{TableItem}"/> containing properties of the table.</returns> public virtual Response <TableItem> CreateTable(string tableName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tableName, nameof(tableName)); using DiagnosticScope scope = _diagnostics.CreateScope($"{nameof(TableServiceClient)}.{nameof(CreateTable)}"); scope.Start(); try { var response = _tableOperations.Create(new TableProperties() { TableName = tableName }, null, queryOptions: _defaultQueryOptions, cancellationToken: cancellationToken); return(Response.FromValue(response.Value as TableItem, response.GetRawResponse())); } catch (Exception ex) { scope.Failed(ex); throw; } }
public virtual Response <TableItem> CreateTable(string tableName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tableName, nameof(tableName)); var response = _tableOperations.Create(new TableProperties(tableName), null, queryOptions: new QueryOptions { Format = _format }, cancellationToken: cancellationToken); return(Response.FromValue(response.Value as TableItem, response.GetRawResponse())); }