title: Querying Nested Dictionaries using LINQ
body: <p>I'm developing a POS system and I need to check whether the database tables on each terminal are out of sync.</p>
  
  <p>I maintain a Dictionary of terminal information, each of which has Dictionary containing table ids with a CRC for each table.  Below is simplified description of what I've got so far (i'm using VB.NET but I've stripped out a lot of stuff to hopefully clarify things):</p>
  
  <pre><code>e.g.   TerminalList = Dictionary(Of Integer, TerminalInfo)
  
         class TerminalInfo
           TerminalID: Integer
           TableCRCs: Dictionary(Of String, TableInfo)
  
         class TableInfo
           TableID: String
           CRC: UInt32
  
  
         TerminalID: 1
            TableID: A   CRC: aa10
            TableID: B   CRC: 1234
  
         TerminalID: 2
            TableID: A   CRC: aa10
            TableID: B   CRC: 1234
  
         TerminalID: 3
            TableID: A   CRC: 12be
            TableID: B   CRC: 1234
  </code></pre>
  
  <p>Is it possible for me to create a LINQ query that will build a list of distinct TableIDs and CRC's?</p>
  
  <pre><code>i.e. A  aa10
       A  12be
       B  1234
  </code></pre>
  
  <p>If the count of this query is greater than the number of tables that i'm interested in then I know that a terminal is out of sync.  I'm not interested in which terminal or which table  is out of sync, only that there is a difference.</p>
  
  <p>TIA,</p>
  
  <p>Simon</p>