public async Task <IBitcoinBlock> GetAsync(string block) { var partitionKey = BicoinBlockEntity.GeneratePartiteonKey(); var rowKey = BicoinBlockEntity.GenerateRowKey(block); return(await _tableStorage.GetDataAsync(partitionKey, rowKey)); }
public static BicoinBlockEntity CreateNew(IBitcoinBlock src) { var result = new BicoinBlockEntity { PartitionKey = GeneratePartiteonKey(), RowKey = GenerateRowKey(src.Hash), Time = src.Time, Height = src.Height, Difficulty = src.Difficulty, Merkleroot = src.Merkleroot, Nextblockhash = src.Nextblockhash, Nonce = src.Nonce, Previousblockhash = src.Previousblockhash, TotalTransactions = src.TotalTransactions }; return(result); }
public Task SaveAsync(IBitcoinBlock bitcoinBlock) { var newEntity = BicoinBlockEntity.CreateNew(bitcoinBlock); return(_tableStorage.InsertOrReplaceAsync(newEntity)); }