public async Task Execute(IFileLocationProvider locationProvider) { var locations = await locationProvider.GetLocation(); foreach (var sourceLocation in locations) { var files = await _fileProcessor.GetFilesListFromLocation(sourceLocation.LocationOnDisk); foreach (var file in files) { var content = await _fileProcessor.GetFileContent(file); var contentObject = JsonSerializer.Deserialize <FileContent>(content); await _mediator.Send(new SumNumberCommand(contentObject, Console.WriteLine)); } } }