Beispiel #1
0
        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);
        }
Beispiel #2
0
 public static BlockSyncedByHashEntity CreateEntity(IBlockSyncedByHash blockSynced)
 {
     return(new BlockSyncedByHashEntity
     {
         PartitionKey = blockSynced.Partition,
         BlockNumber = blockSynced.BlockNumber,
         Partition = blockSynced.Partition,
         BlockHash = blockSynced.BlockHash?.ToLower()
     });
 }