public async Task InsertAsync(IBlockSyncedByHash block) { var entity = BlockSyncedByHashEntity.CreateEntity(block); var index = new AzureIndex(_lastSyncedPartition, block.Partition, entity); await _table.InsertOrReplaceAsync(entity); await _index.InsertOrReplaceAsync(index); }
public static BlockSyncedByHashEntity CreateEntity(IBlockSyncedByHash blockSynced) { return(new BlockSyncedByHashEntity { PartitionKey = blockSynced.Partition, BlockNumber = blockSynced.BlockNumber, Partition = blockSynced.Partition, BlockHash = blockSynced.BlockHash?.ToLower() }); }