title: Adding a column qualifier to many LINQ to SQL constructs at once
body: <p>I have a dbml to which I have added more then 15 tables from an SQL Server 2008 DB.  I then have about 50 LINQ to SQL queries, some quite complex, running against one or more of these tables.</p>
  
  <p>And now the spec has changed, as they tend to do, and there is a version column added to all of these tables, and all the queries need to operate on data from a specific version.</p>
  
  <p>so for example</p>
  
  <pre><code>dim q = from a in dbc.T1, b in dbc.T2
          where a.c1=b.c2 And
          a.c2 &gt; param1
  </code></pre>
  
  <p>needs to become </p>
  
  <pre><code>dim q = from a in dbc.T1, b in dbc.T2
          where a.c1=b.c2 And
          a.c2 &gt; param1 And
          a.version = version_param And 
          b.version = version_param
  </code></pre>
  
  <p>As I said, the LINQ statements are much more complex, and usually involve several tables in each.</p>
  
  <p>Any clever ideas on how I can implement this without editing each query and inserting an </p>
  
  <pre><code>        a.version = version_param
  </code></pre>
  
  <p>qualifier for each table involved?</p>