public async Task WriteAssetsOwnersDataAsync(IAssetsOwners assetOwnersData) { var key = Guid.NewGuid().ToString(); var bytes = assetOwnersData.ToJson().ToUtf8ByteArray(); await _azureBlob.SaveBlobAsync(BlobContainer, key, bytes); await _tableStorage.InsertOrReplaceAsync(AssetsOwnersEntity.CreateNew(assetOwnersData, key)); }
public static AssetsOwnersEntity CreateNew(IAssetsOwners assetsOwners, string blobId) { return(new AssetsOwnersEntity { RowKey = GenerateRowKey(assetsOwners.AssetId), PartitionKey = GeneratePartiteonKey(), BlobId = blobId, BlockHeight = assetsOwners.BlockHeight }); }