title: Sort members of a list of type enum by specific item
body: <p>I have an <code>enum</code>:</p>
  
  <pre><code> public enum Fruits
      {
         Apple = 14,
         Lemon = 174,
         Grapes = 200,
         Peach = 1
      }
  </code></pre>
  
  <p>and a list by this <code>enum</code>:</p>
  
  <pre><code>IEnumerable&lt;Fruits&gt; Fruits = new List&lt;Fruits&gt;();
  </code></pre>
  
  <p>By default when I call <code>getValues</code> on the <code>enum</code> it sorts the entries by their id.
  I show the list as a dropdown in the UI and want to sort the members of the list in specific order. In my sample I want <code>Lemon</code> to be the first item in the list. </p>
  
  <p>I tried to order the items by the Lemon entry with something like this:</p>
  
  <pre><code>Fruits.OrderBy(f =&gt; f.Lemon);
  </code></pre>
  
  <p>but I am not allowed to do this <code>f.Lemon</code> in this context. Maybe I can <code>foreach</code> the list remove the Lemon item and then insert it as a first entry.</p>
  
  <p>I am quite new to programming and I have found some similar questions but not with <code>enum</code> type.</p>