title: Select object and add to list linq c#
body: <p>probably a simple Q but still a beginner at this and not sure on how to....
  Each WorkStation can have a number of Invoices So my below code will....</p>
  
  <p>store all the workStations, go Through each workStation,<br>
  get the last (most recent) invoice for that workStation,<br>
  If the invoices date (for the most recent Invoice) is &lt; 12 Months  </p>
  
  <h2>Add it to the list of sites...</h2>
  
  <p>EDIT:
     Thanks for all the help guys but I am trying to do it through c# and avoid the LINQ searche you guys have mentioned...thanks for everyone who replied...</p>
  
  <p>My new problem being i need to sort the ChosenInvoices list into asceding order and return the first...as i think it is selecting anyone in the list:</p>
  
  <pre><code> var allWorkSites =
              (from worksites in db.Work_Sites
               select worksites).Distinct().ToList();
      List&lt;Object&gt; chosenInvoices = new List&lt;Object&gt;();
  
      foreach (Work_Site worksite in allWorksites)
      {
          Invoice lastInvoice = worksite.Invoices.LastOrDefault();
  
          if (lastInvoice != null)
          {
              if (lastInvoice.Invoice_Date &lt; DateTime.Now.AddMonths(-12))
              {
                  chosenInvoices.Add(workstation);
              }
          }
      }
  </code></pre>