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