title: Applying LINQ to Objects Group By and Sort By to generic List<T> (C#)
body: <p>I am having a hard time creating working Group By and Sort By clauses against a generic List myList.
   myList has a list of property 'Settings' which itself contains a list of 'child' properties for each business.</p>
  
  <p>I want to group by a Industry and within each Industry, sort by business name.  My intent would be this:</p>
  
  <pre><code>string groupSetting = "Industry";
  sortSetting = "BusinessName";
  myList.GroupBy(p =&gt; p.Settings.Find(s =&gt; s.Name == groupSetting)).OrderBy(p =&gt; p.Settings.Find(t =&gt; t.Name == sortSetting));
  </code></pre>
  
  <p>However I am getting the error : 
  '<em>System.Linq.IGrouping does not contain a definition for Settings and no extension method Settings accepting a first argument of type System.Linq.Igrouping could be found....</em>' indicating I cannot invoke the order by clause without some transformation or additional treatment.</p>
  
  <p>I have tried all sorts of things to split this out and get it working, but I am missing something.   Any help appreciated</p>