title: Get current and previous Item with Linq
body: <p>I have a Offer class like</p>
  
  <pre><code>public class Offer
  {
      public int OfferID { get; set; }
      public DateTime OfferDate { get; set; }
      public int CustomerID { get; set; }
  }
  </code></pre>
  
  <p>Now I have a lot of offers like this</p>
  
  <pre><code>List&lt;Offer&gt; oList = new List&lt;Offer&gt;();
  oList.Add(new Offer() { OfferID = 1, OfferDate = new DateTime(2018, 01, 01), CustomerID = 1 });
  oList.Add(new Offer() { OfferID = 2, OfferDate = new DateTime(2018, 01, 03), CustomerID = 1 });
  oList.Add(new Offer() { OfferID = 3, OfferDate = new DateTime(2018, 01, 01), CustomerID = 2 });
  oList.Add(new Offer() { OfferID = 4, OfferDate = new DateTime(2018, 01, 05), CustomerID = 2 });
  oList.Add(new Offer() { OfferID = 5, OfferDate = new DateTime(2018, 01, 02), CustomerID = 1 });
  </code></pre>
  
  <p>And I want to get a Offer by ID but also the previous Offer of this customer by Date. </p>
  
  <p>Currently I'm using Linq2SQL and I make two selects. First I select the required Offer by ID and then I select the previous one by <code>OfferDate</code>.</p>
  
  <p>Example: In case of <code>OfferID==5</code>  the previous Offer of this Customer is <code>OfferID==1</code>.</p>
  
  <pre><code>public List&lt;Offer&gt; GetCurrentAndPrevious(int OfferID)
  {
      using (DataContext cx = new DataContext())
      {
          Offer oCurrent = cx.Offer.Single(x =&gt; x.OfferID = OfferID);
          Offer oPrevious = cx.Offer.OrderBy(x =&gt; x.OfferDate)
                                    .Last(x =&gt; x.CustomerID = oCurrent.CustomerID &amp;&amp; x.OfferDate &lt; oCurrent .OfferDate);
          return new List&lt;Offer&gt;() { oCurrent , oPrevious };
      }
  }
  </code></pre>
  
  <p>Question: Is there a way to solve this with one query instead of querying the database twice?</p>