예제 #1
0
        private async Task SaveEntity(Block entity, bool isImported = false)
        {
            var blockJson = JsonConvert.SerializeObject(entity);
            var blobData  = Encoding.UTF8.GetBytes(blockJson);

            await _blobStorage.SaveBlobAsync(BlobContainer, entity.Hash, blobData);

            var blockRecord = BlockEntity.Create(entity.Hash, isImported);

            await _blockTable.InsertOrReplaceAsync(blockRecord);
        }