Ejemplo n.º 1
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}]");
                }
            }
        }
Ejemplo n.º 2
0
 public CosmosTableStorage(StrongCloudTableClient tableClient, string tableName)
 {
     tableName_ = tableName;
     Table      = tableClient.GetTableReference(tableName_);
 }