title: MVC LINQ Sort / OrderBy a Model
body: <p>the for each loop works properly setting the <code>PickupDistanceSort</code> column correctly, but then I can't get the model to sort so that I can display the rows in ascending order based on the newly set <code>PickupDistanceSort</code> values.  <code>PickupDistanceSort</code> is a data type of long.  The model displays in the view, it's just not sorted.  <strong>How do you sort a model before it's sent to the view?</strong> </p>
  
  <pre><code>    public ActionResult JobsDistanceSorted()
      {            
          var model = from j in db.Jobs select j;
  
          foreach (var item in model)
          {
              item.PickupDistanceSort = ICN.CustomMethods.
                     GetDistance(34.180046081543, -118.309028625488,
                     item.PickupLatitude, item.PickupLongitude);
          }
  
          model = model.OrderBy(s =&gt; s.PickupDistanceSort);
          return View("JobHeadings", model);
      }
  </code></pre>