title: How to sort an array containing class objects by a property value of a class instance?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1301822/how-to-sort-an-array-of-object-by-a-specific-field-in-c">How to sort an array of object by a specific field in C#?</a>  </p>
  </blockquote>
  
  <p>Given the following code:</p>
  
  <pre><code>MyClass myClass;
  MyClassArray[] myClassArray = new MyClassArray[10];
  
  for(int i; i &lt; 10; i++;)
  {
      myClassArray[i] = new myClass();
      myClassArray[i].Name = GenerateRandomName();
  }
  </code></pre>
  
  <p>The end result could for example look like this:</p>
  
  <pre><code>myClassArray[0].Name //'John';
  myClassArray[1].Name //'Jess';
  myClassArray[2].Name //'James';
  </code></pre>
  
  <p>How would you sort the MyClassArray[] array according to the myClass.Name property alphabetically so the array will look like this in the end:</p>
  
  <pre><code>myClassArray[0].Name //'James';
  myClassArray[1].Name //'Jess';
  myClassArray[2].Name //'John';
  </code></pre>
  
  <p><strong>*Edit</strong>: I'm using VS 2005/.NET 2.0.</p>