Multiple conditions for same table in EF I am getting products using given parameters (name of real entity and columns changed for illustration purposes),

    public IQueryable&lt;Product&gt; GetProductsByPara(string price, string weight, string dimensions, string trend)
    {
        var result = dbContext.Products.Where(a =&gt;
            a.Price.ToLower().Equals(price.ToLower()) &amp;&amp; 
            a.Weight.ToLower().Equals(weight.ToLower()) &amp;&amp;
            a.Dimensions.ToLower().Equals(dimensions.ToLower()) &amp;&amp;
            a.Trend.ToLower().Equals(trend.ToLower()));
        if (result.Any())
        {
            return result;
        }

        if (!string.IsNullOrWhiteSpace(price))
        {
            result = dbContext.Products.Where(a =&gt;
                a.Price.ToLower().Equals(price.ToLower()) &amp;&amp; 
                a.Weight.ToLower().Equals(weight.ToLower()) &amp;&amp;
                a.Trend.ToLower().Equals(trend.ToLower()));
            if (result.Any())
            {
                return result;
            }
        }

        if (!string.IsNullOrEmpty(dimensions))
        {
            result = dbContext.Products.Where(a =&gt;
                a.Dimensions.ToLower().Equals(dimensions.ToLower()) &amp;&amp;
                a.Weight.ToLower().Equals(weight.ToLower()) &amp;&amp;
                a.Trend.ToLower().Equals(trend.ToLower()));
            if (result.Any())
            {
                return result;
            }
        }

        return result;
    }
Here is an approach to get rid of some of the redundancy:

First write an extension Method

static IQueryable&lt;Product&gt; FilterForParameters
    (this IQueryable&lt;Product&gt; query, string price, string weight, string dimensions, string trend)
{
    if (price != null)
        query = query.Where(p =&gt; p.Price.ToLower().Equals(price.ToLower()));

    if (weight != null)
        query = query.Where(p =&gt; p.Weight.ToLower().Equals(weight.ToLower()));

    if (dimensions != null)
        query = query.Where(p =&gt; p.Dimension.ToLower().Equals(dimensions.ToLower()));

    if (trend != null)
        query = query.Where(p =&gt; p.Trend.ToLower().Equals(trend.ToLower()));

    return query;
}


Then change your method

public IQueryable&lt;Product&gt; GetProductsByPara(string price, string weight, string dimensions, string trend)
{
    var products = dbContext.Products;

    var productsFilterdByAll = products.FilterForParameters(price, weight, dimensions, trend);
    if (productsFilterdByAll.Any())
        return productsFilterdByAll;

    var productsFilterdByAllButDimnensions = products.FilterForParameters(price, weight, null, trend);
    if (productsFilterdByAllButDimnensions.Any())
        return productsFilterdByAllButDimnensions;

    var productsFilterdByAllButPrice = products.FilterForParameters(null, weight, dimensions, trend);
    return productsFilterdByAllButPrice;
}


Depending on the context, it would also be a good idea to check your parameters for null at the beginning of the method.