title: Storing date/time of Last Application Run
body: <p>I'm working with a console application (C#) at the moment. What it does is pulls files from a database and stores them in their relevant folders on the C drive on a local machine.</p>
  
  <p>At the moment, every time I run the console app, it pulls ALL the files from the database. </p>
  
  <p>What I would like to be able to do, is each time I run it, It only pulls the files that were submitted since I last ran the console application. Currently, this is the linq statement that pulls the files from the database.</p>
  
  <pre><code>var titleObjects = ctn.Titles.Where(t =&gt; !t.Deleted &amp;&amp; t.SubmissionState == 2 &amp;&amp;(t.Approved.HasValue &amp;&amp; t.Approved.Value)).Select(t =&gt; t);
  </code></pre>
  
  <p>Ideally I'd like something like the following where the date and time of the last run of the application is stored somewhere:</p>
  
  <pre><code>var titleObjects = ctn.Titles.Where(t =&gt; !t.Deleted &amp;&amp; t.SubmissionState == 2 &amp;&amp; t.CreatedDate &gt;= LastAppRun &amp;&amp; t.CreatedDate &lt;= DateTime.Now  &amp;&amp; (t.Approved.HasValue &amp;&amp; t.Approved.Value)).Select(t =&gt; t);
  </code></pre>
  
  <p>I'm unsure on how to go about achieving this. If anyone had any advice on it I'd be very greatful :)</p>