Esempio n. 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);
        }
Esempio n. 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}]");
                }
            }
        }
Esempio n. 3
0
 public CosmosTableStorage(StrongCloudTableClient tableClient, string tableName)
 {
     tableName_ = tableName;
     Table      = tableClient.GetTableReference(tableName_);
 }
Esempio n. 4
0
 public CosmosTypedTableStorage(StrongCloudTableClient tableClient, AzureContextOptions options, string name, bool createOnDemand)
     : base(tableClient, options.GetTableName(name), createOnDemand)
 {
 }
Esempio n. 5
0
 public CosmosTypedTableStorage(StrongCloudTableClient tableClient, AzureContextOptions options, string name)
     : base(tableClient, options.GetTableName(name))
 {
 }
Esempio n. 6
0
 public CosmosTypedTableStorage(StrongCloudTableClient tableClient, AzureContextOptions options)
     : base(tableClient, options.GetTableName(typeof(Entry).Name))
 {
 }