How to make efficient search with LINQ in MVC4?
<p>Hi I am developing MVC4 application. I am developing one search page which contains 5 textboxes and search button in which only one textbox is mandatory field. Remaining are not mandatory. I want to have AND of all 5 textbox values. My query is as below.</p>

<pre><code>var logDetails = (from c in db.ts_upldlog_content
join tbl in db.ts_upld_doc on c.upld_docid equals tbl.upld_docid
join doc in db.tm_doc_type on tbl.upld_doctypeid equals doc.doc_typeid
where 
(tbl.upld_clientid == clientId &amp;&amp; tbl.upld_employeeid == employeeID &amp;&amp; tbl.upld_empcitizenid == citizenId &amp;&amp; tbl.upld_doctypeid == typeofDocument &amp;&amp; EntityFunctions.TruncateTime(c.updatedOn) &gt;= start &amp;&amp; EntityFunctions.TruncateTime(c.updatedOn) &lt; end)
    select new logdetails
    {
    //Getting all properties
    }).toList();
</code></pre>

<p>My problem is In the above query start and end are mandatory so i will get some value from UI. Let me explain one scenario. User will supply start and end and remaining will be null. My query will not yield results because I am doing &amp;&amp; operation and my other fields may have some value in DB.
Lets conside below table.</p>

<pre><code>clientID    EmployeeID   EmpCitiID  docType      Date
123         456          456        1            10/19/2016
</code></pre>

<p>When i Pass only Date my query will not work because I am doing &amp;&amp; operation. so Is there any way to achieve this scenario? Any help would be appreciated. Thank you.</p>