title: how to sort strings with C#
body: <p>I have a class like </p>
  
  <pre><code>public class KeyNamePair
  {
   public string Key {get;set;}
  
   public string Name{get;set;}
  }
  </code></pre>
  
  <p>My code</p>
  
  <pre><code>List&lt;KeyNamePair&gt; list =new List&lt;KeyNamePair&gt;();
  
      list.Add("1", "Day 1");
      list.Add("2", "Day 11");
      list.Add("4", "Day 5");
      list.Add("6", "Day 13");
  </code></pre>
  
  <p>How can i sort the list to display</p>
  
  <pre><code>&gt;  "Day1", "Day5", "Day 11", "Day 13"
  </code></pre>
  
  <p>in order?</p>
  
  <p>i tried </p>
  
  <pre><code>var SortedList = source.OrderBy(x =&gt; x.Name).ToList();
              return SortedList;
  </code></pre>
  
  <p>this does not do any sort</p>