private void saveEntity(Block entity, bool isImported = false)
        {
            var serializedEntity = JsonConvert.SerializeObject(entity);

            _context.InsertBlock(entity.Hash, entity.Height, entity.Time, entity.Confirmations, entity.Difficulty,
                                 entity.MerkleRoot, entity.Nonce, entity.TotalTransactions, isImported, entity.PreviousBlock, serializedEntity);
        }
        private async Task saveEntity(Block entity, bool isImported = false)
        {
            try
            {
                var serializedEntity = JsonConvert.SerializeObject(entity);

                _context.InsertBlock(entity.Hash, entity.Height, entity.Time, entity.Confirmations, entity.Difficulty,
                                     entity.MerkleRoot, entity.Nonce, entity.TotalTransactions, isImported, entity.PreviousBlock, serializedEntity);
            }
            catch (Exception e)
            {
                await _log.WriteError("BlockRepository", "saveEntity", entity.ToJson(), e);
            }
        }