title: Delete Files that are more than than 10 days old using Linq
body: <p>i'm using the code below to delete the files that are more than 10 days old. Is there a simpler/smarter way of doing this?</p>
  
  <pre><code>string source_path = ConfigurationManager.AppSettings["source_path"];
              string filename= ConfigurationManager.AppSettings["filename"];
  
              var fileQuery= from file in Directory.GetFiles(source_path,filename,SearchOption.TopDirectoryOnly)
                             where File.GetCreationTime(file)&lt;System.DateTime.Now.AddDays(-10)
                             select file;
  
              foreach(var f in fileQuery)
              {
                  File.Delete(f);
              }
  </code></pre>