title: Linq OrderBy does not sort a List<T>. How do I sort the list?
body: <p>Having issues with the OrderBy clause not having any impact on the sort. I have walked through this in the debugger and insuring this is a case that the sort line of the code is being hit and reviewing the results after it the order by has not been applied.</p>
  
  <pre><code>public static IEnumerable&lt;DDLOptions&lt;TValueType&gt;&gt; GetDDLOptionsViewModel&lt;TClass, TValueType&gt;(
              IEnumerable&lt;TClass&gt; list, 
              Func&lt;TClass, TValueType&gt; value, 
              Func&lt;TClass, string&gt; displayText,
              bool sort = true
          )
          {
              List&lt;DDLOptions&lt;TValueType&gt;&gt; ddlOptions;
  
              ddlOptions = list.Select(
                  l =&gt; new DDLOptions&lt;TValueType&gt;
                          {
                              Value = value(l),
                              DisplayText = displayText(l)
                          }
                      ).ToList();  &lt;========== Works if I put the Order By here.
  
              if (sort)
              {
                  ddlOptions.OrderBy(l =&gt; l.DisplayText); &lt;===== Does NOT work here.
              }
  
              return ddlOptions;
          }
  </code></pre>