Exemplo n.º 1
0
        public WalletRuleEntry AddWalletRule(string walletId, WalletRule walletRule)
        {
            var table  = Configuration.GetWalletRulesTable();
            var entry  = new WalletRuleEntry(walletId, walletRule);
            var entity = entry.CreateTableEntity();

            table.ExecuteAsync(TableOperation.InsertOrReplace(entity)).GetAwaiter().GetResult();
            return(entry);
        }
Exemplo n.º 2
0
        public WalletRuleEntry[] GetWalletRules(string walletId)
        {
            var table          = Configuration.GetWalletRulesTable();
            var searchedEntity = new WalletRuleEntry(walletId, null).CreateTableEntity();
            var query          = new TableQuery()
                                 .Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, searchedEntity.PartitionKey));

            return
                (table.ExecuteQuery(query)
                 .Select(e => new WalletRuleEntry(e, this))
                 .ToArray());
        }