public TableStorageRepository(ICloverConfig config, string tableName) { tableInit = new Func <Task <CloudTable> >(async() => { var storageCredentials = new StorageCredentials( config.Get(CloverConfigEnum.CLOVER_STORAGE_ACCOUNT), config.Get(CloverConfigEnum.CLOVER_STORAGE_KEY) ); CloudStorageAccount storageAccount = new CloudStorageAccount(storageCredentials, true); CloudTableClient tableClient = storageAccount.CreateCloudTableClient(); CloudTable table = tableClient.GetTableReference(tableName); await table.CreateIfNotExistsAsync(); return(table); }); }
public UserRepository(ICloverConfig config) : base(config, "users") { }