title: How do I sort on a column that isn't in the database with LINQ to entities?
body: <p>LINQ to Entities 3.5 doesn't support String.Join so I'm binding my gridview to a property I define outside the Select statement. Obviously it's not letting me sort on RecipientNames because it's just an IEnumerable and that doesn't make sense. How can I use LINQ to Entities to sort on my new column? If possible I'd like to get rid of RecipientNamesList altogether and create something that LINQ will be able to handle for sorting.</p>
  
  <pre><code>IQueryable&lt;NotificationDetail&gt; resultsFlattened = results.Select(n =&gt; new NotificationDetail() 
  {
  ..
  RecipientNames = n.NotificationRecipients.Select(nr =&gt; nr.Recipient.RecipientNameFirst + " " + nr.Recipient.RecipientNameLast).Where(s =&gt; s.Trim().Length &gt; 0)});
  });
  
  IQueryable&lt;NotificationDetail&gt; resultsPaged = ApplySortingPaging(resultsFlattened,SortPageOptions);
  
  return resultsPaged.ToEntityList(results.Count()); //blows up here, obviously
  
  public string RecipientNamesList
  {
      get
      {
            return String.Join(", ", RecipientNames.ToArray());
      }
  }
  </code></pre>