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); }
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()); }