コード例 #1
0
        async Task DbStoreBackupAsync(string store, IDbStore dbStore, string latestBackupDirPath)
        {
            try
            {
                IList <Item> items = new List <Item>();
                await dbStore.IterateBatch(
                    int.MaxValue,
                    (key, value) =>
                {
                    items.Add(new Item(key, value));
                    return(Task.CompletedTask);
                });

                await this.dataBackupRestore.BackupAsync(store, latestBackupDirPath, items);
            }
            catch (IOException exception)
            {
                throw new IOException($"The backup operation for {store} failed with error.", exception);
            }
        }