 <p>Try this</p> <pre><code> var query = context.Products .Where(a =&gt; request.SearchTerm == null || a.Name.Contains(request.SearchTerm)) .Where(a =&gt; (a.OrderType == "X" &amp;&amp; request.isTypeA) || (a.OrderType == "R" &amp;&amp; request.typeB) || (a.OrderType == "D" &amp;&amp; request.typeC)) .Where (a=&gt; a.OrderType != "U") .Where(a =&gt; a.IsInactiveFlag == false ) .OrderBy(a =&gt; a.OrderType) .Select(c =&gt; new ProductType { ProductTypeId = c.ProductTypeId, IsSelected = false, OrderType = c.OrderType, Name = c.Name, IsInactiveFlag = c.IsInactiveFlag }); </code></pre>