title: Get previous record to current one using LINQ
body: <p>If I have a list of items, and say the "id" is unique, but not necessarily sequential, is there a way to find the previous entity in say either a List or an IEnumerable?</p>
  
  <p>So I may have a list of people, and they each have an id and they are sorted in an order I am not aware of.  All I get is the list and the id of the person.</p>
  
  <p>Now I need to get the previous person to the id that was provided to me.</p>
  
  <p>Is there a nice LINQ way to do this or do I simply find the record and get the previous one in a ForEach?</p>
  
  <p><strong>edit</strong>
  I just found this, is this the best approach?</p>
  
  <p><a href="https://stackoverflow.com/questions/3683105/calculate-difference-from-previous-item-with-linq/3683217#3683217">Calculate difference from previous item with LINQ</a></p>