title: Case Statement In linq query on where condition using c#
body: <p>I need the result in the basic of where statement , but I am getting ALL THE records, how to give a case statement  in linq where condition. If empty data  is 
  given to search  means  it should search that field. </p>
  
  <p>my c# code</p>
  
  <pre><code> var TicketDetails = (from issuecases in caseModelDatabase.IssueCases
                             where ( DbFunctions.TruncateTime(issuecases.CreatedDate) &gt;= DbFunctions.TruncateTime(IssueDetails.StartDate)
                             &amp;&amp; DbFunctions.TruncateTime(issuecases.CreatedDate) &lt;=  DbFunctions.TruncateTime(IssueDetails.ToDate)
  
                             || ((!string.IsNullOrEmpty(IssueDetails.TicketArea) &amp;&amp; issuecases.TicketArea.Equals(IssueDetails.TicketArea))
                             || (!string.IsNullOrEmpty(IssueDetails.TicketType) &amp;&amp;  issuecases.TicketType.Equals(IssueDetails.TicketType))
                             || (!string.IsNullOrEmpty(IssueDetails.Status) &amp;&amp;  issuecases.Status.Equals(IssueDetails.Status))))
                             select new { 
  
                                 issuecases.WorkRequestId,
                                 issuecases.Summary,
                                 issuecases.Status,
                                 issuecases.CreatedDate,
                                 issuecases.UpdatedDate
                             }).ToList();
  </code></pre>