title: asp.net order and GroupBy lists in a dictionary in a controller mvc3 class
body: <p>I am working on an asp.net mvc3 application with linq2sql.</p>
  
  <p>I have a List of SiteLog object type containing also for each object: A string named CLRExceptionType and a date named EntryDate. This List is included in a Dictionary:</p>
  
  <pre><code>private Dictionary&lt;string, List&lt;SiteLog&gt;&gt; dataBaseList = new Dictionary&lt;string, List&lt;SiteLog&gt;&gt;();
  DataClasses1DataContext db = new DataClasses1DataContext("string1");
  DataClasses1DataContext db2 = new DataClasses1DataContext("string2");
  </code></pre>
  
  <p>And I populate the vocabulary in the same controller in a function:</p>
  
  <pre><code>       private void CreateDictionary()
      {   
          dataBaseList.Add("db", db.SiteLogs.ToList());
          dataBaseList.Add("db2", db2.SiteLogs.ToList());
      }
  </code></pre>
  
  <p>So for each "Database" I have a list of Exception occurred.</p>
  
  <p>Now I have to display on the view, for each database, the exception occurred grouped by exception and ordered by date.</p>
  
  <p>So for example the output will be: Database1: <br>
  Exception1 (22 times) last occurred: 22.10.1989 19:30<br>
  Exception2 (2 times) last occurredd 20.5.1980 14.50<br></p>
  
  <p>Then suddenly the object is updated with a new entry with the name Exception2 so I have to display:<br>
  Exception2 (3 times) last occurredd 20.7.2011 9:00<br>
  Exception1 (22 times) last occurred: 22.10.1989 19:30<br></p>
  
  <p>How can I achieve this using the groupby or any other solution in the controller?
  I return the dictionary to the view.</p>
  
  <p>Thanks in advance</p>