title: List<> sorting by object property
body: <p>I need to sort a list of objects by one of the object's properties, but it's a string that needs to be sorted as if it's an integer. The objects are custom "Property" objects where the property name (property.Name) is a string, however 90% of the property names are actually numbers while the other 10% are names/letters (hence while the variable itself has to be a string and not an integer).</p>
  
  <p>I know I can use</p>
  
  <pre><code>propertyList.OrderBy(x =&gt; x.Name)
  </code></pre>
  
  <p>...but that will sort it looking at it as if it's a string (i.e. 15000 is "greater" than 20).</p>
  
  <p>For sorting purposes, I've already split the list into two separate lists (one that holds all the ones with property names that contain letters and another that contains the ones that can be converted to integers), but I don't know how to sort the "integer" list.</p>
  
  <p>I've tried this and it doesn't work, but is there something like this I can use?</p>
  
  <pre><code>propertyList.OrderBy(x =&gt; Convert.ToInt32(x.Name))
  </code></pre>