示例#1
0
        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);
            });
        }
示例#2
0
 public UserRepository(ICloverConfig config) : base(config, "users")
 {
 }