I have a simple method:
internal void run()
{
foreach (string file in Directory.GetFiles(Path).ToList()
.Where(x => DateTime.Today.Subtract(File.GetCreationTime(x)).Days > NumberOfDays))
{
File.Delete(file);
}
}
Is it possible to get rid of the foreach statement?