public async Task InsertAsync(IBlockSynced block) { var entity = BlockSyncedEntity.CreateEntity(block); var index = new AzureIndex(_lastSyncedPartition, block.CoinAdapterAddress, entity); await _table.InsertOrReplaceAsync(entity); await _index.InsertOrReplaceAsync(index); }
public static BlockSyncedEntity CreateEntity(IBlockSynced blockSynced) { return(new BlockSyncedEntity { PartitionKey = GetPartitionKey(blockSynced.CoinAdapterAddress), BlockNumber = blockSynced.BlockNumber, CoinAdapterAddress = blockSynced.CoinAdapterAddress }); }