Beispiel #1
0
        public static StrongCloudTableClient CreateClient(CloudStorageAccount saConnection)
        {
            var tableClient = new StrongCloudTableClient(saConnection.TableStorageUri, saConnection.Credentials);

            tableClient.DefaultRequestOptions = new TableRequestOptions
            {
                MaximumExecutionTime = TimeSpan.FromSeconds(15),
                ServerTimeout        = TimeSpan.FromSeconds(10),
            };

            return(tableClient);
        }
Beispiel #2
0
        public CosmosTableStorage(StrongCloudTableClient tableClient, string tableName, bool ensureExists)
        {
            tableName_ = tableName;

            Table = tableClient.GetTableReference(tableName_);

            var exists = Table.ExistsAsync().Result;

            if (!exists)
            {
                if (ensureExists)
                {
                    Table.CreateIfNotExistsAsync().Wait();
                }
                else
                {
                    throw new Exception($"table does not exist and creation not allowed. name:[{tableName}]");
                }
            }
        }
Beispiel #3
0
 public CosmosTableStorage(StrongCloudTableClient tableClient, string tableName)
 {
     tableName_ = tableName;
     Table      = tableClient.GetTableReference(tableName_);
 }
Beispiel #4
0
 public CosmosTypedTableStorage(StrongCloudTableClient tableClient, AzureContextOptions options, string name, bool createOnDemand)
     : base(tableClient, options.GetTableName(name), createOnDemand)
 {
 }
Beispiel #5
0
 public CosmosTypedTableStorage(StrongCloudTableClient tableClient, AzureContextOptions options, string name)
     : base(tableClient, options.GetTableName(name))
 {
 }
Beispiel #6
0
 public CosmosTypedTableStorage(StrongCloudTableClient tableClient, AzureContextOptions options)
     : base(tableClient, options.GetTableName(typeof(Entry).Name))
 {
 }