public async Task <IEnumerable <IOutput> > GetSpentOutputs(IEnumerable <IOutput> outputs)
 {
     return(await _table.GetDataAsync(outputs.Select(o =>
                                                     new Tuple <string, string>(SpentOutputEntity.GeneratePartitionKey(o.TransactionHash), SpentOutputEntity.GenerateRowKey(o.N)))));
 }
        public Task InsertSpentOutputs(Guid operationId, IEnumerable <IOutput> outputs)
        {
            var entities = outputs.Select(o => SpentOutputEntity.Create(o.TransactionHash, o.N, operationId));

            return(Task.WhenAll(entities.GroupBy(o => o.PartitionKey).Select((group) => _table.InsertOrReplaceAsync(group))));
        }