Пример #1
0
        public async Task Execute()
        {
            var folders = await _dataRepository.GetFolders();

            foreach (var folder in folders)
            {
                folder.Size = IOHelpers.DirSize(new DirectoryInfo(folder.Path));

                await _dataRepository.UpdateFolder(folder);
            }
        }
Пример #2
0
        public async Task Execute(PerformContext context)
        {
            var folders = await _dataRepository.GetFolders();

            var overallProgressbar = context.WriteProgressBar();

            foreach (var folder in folders.WithProgress(overallProgressbar))
            {
                folder.Size = IOHelpers.DirSize(new DirectoryInfo(folder.Path));

                await _dataRepository.UpdateFolder(folder);
            }
        }