title: LINQ query structure with if statement?
body: <p>I have a full LINQ query built out.  I need one query run if the user is a manager/team lead and a separate query run if they are not.  However the queries are very similar.</p>
  
  <p>Manager/Teamleads get to see everything.  Where as others only see what they are certified for.</p>
  
  <pre><code>var model = (from d in department
                  join f in db.IPACS_Function on d.departmentID equals f.departmentID
                  join pg in db.IPACS_Process on f.functionID equals pg.functionID
                  join sop in db.IPACS_Procedure on pg.processID equals sop.processID
                  // Non-Manager/Teamlead portion
                  join cert in db.IPACS_Certification on sop.procedureID equals cert.procedureID
                  join procdoc in db.IPACS_ProcedureDocs on sop.procedureID equals procdoc.procedureID
                  join doc in db.IPACS_Document on procdoc.documentID equals doc.documentID
                  where cert.adUserName == currUser &amp;&amp; cert.certifiedDate &gt; doc.dateApproved
                  // End non-manager/team lead
                  select new IPACS_DT_MasterList
                  {
                      departmentID = d.departmentID,
                      functionID = f.functionID,
                      processID = pg.processID,
                      procedureID = sop.procedureID,
                      departmentName = d.name,
                      functionName = f.name,
                      processName = pg.name,
                      procedureName = sop.name,
                      owner = sop.owner,
                      automated = (bool)sop.automated
                  });
  </code></pre>
  
  <p>Is what I am trying to do above possible without creating two separate <code>var model =</code> statements?</p>