public Task UpsertBlockAsync(Block source) { CinderBlock document = source.MapToStorageEntityForUpsert <CinderBlock>(); document.Sha3Uncles = source.Sha3Uncles; document.Uncles = source.Uncles; document.UncleCount = source.Uncles.Length; return(UpsertDocumentAsync(document)); }
public async Task UpsertBlockAsync(Nethereum.RPC.Eth.DTOs.Block source) { using (var context = _contextFactory.CreateContext()) { var block = await context.Blocks.FindByBlockNumberAsync(source.Number).ConfigureAwait(false) ?? new Block(); block.MapToStorageEntityForUpsert(source); context.Blocks.AddOrUpdate(block); await context.SaveChangesAsync().ConfigureAwait(false); } }
public async Task UpsertBlockAsync(Nethereum.RPC.Eth.DTOs.Block source) { var block = source.MapToStorageEntityForUpsert(); await Write(block).ConfigureAwait(false); }