Пример #1
0
        private static async Task <Guid> ReadGuidAsync(IBackupReader reader, string file)
        {
            var read = Guid.Empty;

            await using (var stream = await reader.OpenBlobAsync(file))
            {
                var buffer = new byte[16];

                _ = await stream.ReadAsync(buffer);

                read = new Guid(buffer);
            }

            return(read);
        }
Пример #2
0
 private async Task ReadAssetAsync(DomainId appId, IBackupReader reader,
                                   CancellationToken ct)
 {
     try
     {
         await using (var stream = await reader.OpenBlobAsync(AvatarFile, ct))
         {
             await appImageStore.UploadAsync(appId, stream, ct);
         }
     }
     catch (AssetAlreadyExistsException)
     {
     }
     catch (FileNotFoundException)
     {
     }
 }