title: LINQ query to get all products with in Min & Max price range?
body: <p>I want to fetch all products in the range of min &amp; max price. Actually I am passing a product(object) with price range in it, and by taking its Min &amp; Max price value I want to fetch all products from database in that range.
  I have try something like:</p>
  
  <pre><code>public List&lt;Products&gt; SuggestedProducts(Product product)
  {
      List&lt;Product&gt; products = (from c in db.Products.Include(x = &gt; x.Category).Include(x = &gt; x.User.CityId.Country).Include("Images")
                                where (c.MinPrice &gt;= product.MinPrice) &amp;&amp; (c.MinPrice &lt;= product.MaxPrice)
                                where (c.MaxPrice &lt;= product.MaxPrice) &amp;&amp; (c.MaxPrice &gt; product.MinPrice)
                                where (c.User.CityId.Id == product.User.CityId.Id)
                                where (c.User.Id != product.User.Id)
                                select c).ToList();
  
      return products;
  }
  </code></pre>
  
  <p>In above code, I am getting (or trying to get) all those products that fall between range of product I am passing.
  <strong>Which is not working properly. I need query to fetch my desired Product</strong></p>
  
  <p>Note: I used <code>c.User.CityId.Id == product.user.CityId.Id</code> to fetch products of same location &amp; <code>c.User.Id != product.user.Id</code> to skip products from same user.</p>