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); } }
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); } }