public AzureTable(AzureTrainEventsStorageOptions options)
        {
            var tableName = options.RawEventsTableName;

            var storageAccount = CloudStorageAccount.Parse(options.StorageAccountConnectionString);

            var tableClient = storageAccount.CreateCloudTableClient(new TableClientConfiguration());

            var table = tableClient.GetTableReference(tableName);

            if (!table.Exists())
            {
                throw new ArgumentException($"Table {tableName} does not exist. Please, first create the table");
            }

            _table = table;
        }
Exemple #2
0
 public AzureTableFactory(
     IOptions <AzureTrainEventsStorageOptions> azureTrainEventsStorageOptionsAccessor)
 {
     _azureTrainEventsStorageOptions = azureTrainEventsStorageOptionsAccessor.Value;
 }