title: How do I implement a dynamic 'where' clause in LINQ?
body: <p>I want to have a dynamic <code>where</code> condition. </p>
  
  <p>In the following example:</p>
  
  <pre><code>var opportunites =  from opp in oppDC.Opportunities
                      join org in oppDC.Organizations 
                          on opp.OrganizationID equals org.OrgnizationID
                      where opp.Title.StartsWith(title)
                      select new
                      {
                          opp.OpportunityID,
                          opp.Title,
                          opp.PostedBy,
                          opp.Address1,
                          opp.CreatedDate,
                          org.OrganizationName
                      };
  </code></pre>
  
  <p>Some times I have <code>Title</code> and sometimes I don't. And also I want to add date in <code>where</code> clause dynamically.</p>
  
  <p>For example, like this SQL:</p>
  
  <pre><code>string whereClause;
  string SQL = whereClause == string.Empty ? 
       "Select * from someTable" : "Select * from someTable" + whereclause
  </code></pre>