title: Custom Ordering in C#
body: <p>There is a list of <code>Package</code> item is sorted by <code>GUID</code>, but I need to order them as follows </p>
  
  <p><code>KK %, AB, AB art, DD %, FV, ER, PP and WW</code></p>
  
  <p>I have implemented as follows, but I wonder is there a better way of doing it? </p>
  
  <pre><code>List&lt;PackageType&gt; list = new List&lt;PackageType&gt; (8);           
  foreach (var a in mail.Package)
  {
   if (a.Name == "KK %")
      list[0] = a;
   else if (a.Name == "AB art")
      list[1] = a;
   else if (a.Name == "AB")
      list[2] = a;
   else if (a.Name == "DD %")
      list[3] = a;
   else if (a.Name == "FV")
      list[4] = a;
   else if (a.Name == "ER")
      list[5] = a;
   else if (a.Name == "PP")
      list[6] = a;
   else if (a.Name == "WW")
     list[7] = a;
  }
  </code></pre>