title: How to Search with multiple parameters in LINQ Where Clause
body: <p>I have a Travel Project (ASP.NET MVC4). I want to Search Tours with multiple parameters in a LINQ where clause.</p>
  
  <p>This is my View:</p>
  
  <pre><code>&lt;form class="green" id="formsearchtravel" method="get" action="@Url.Content("~/" + "search")"&gt;
                      &lt;div class="col-lg-3 col-sm-6"&gt;
                          &lt;select name="destination" &gt;
                                  &lt;option value="any"&gt;All &lt;/option&gt;
                                  &lt;option value="India"&gt;Ấn độ&lt;/option&gt;
                                  &lt;option value="thailand"&gt;Thailand&lt;/option&gt;
                                  &lt;option value="japan"&gt;Nhật bản&lt;/option&gt;
                                  &lt;option value="uk"&gt;Anh&lt;/option&gt;
                              &lt;/select&gt;
                      &lt;/div&gt;
                      &lt;div class="col-lg-3 col-sm-6"&gt;
                         &lt;select name="duration" &gt;
                                  &lt;option value="any"&gt;All&lt;/option&gt;
                                  &lt;option value="5"&gt;from 0 - 5&lt;/option&gt;
                                  &lt;option value="10"&gt;from 05 -10&lt;/option&gt;
                                  &lt;option value="15"&gt;from 10 -15&lt;/option&gt;
                                  &lt;option value="16"&gt;over 15 days&lt;/option&gt;
                              &lt;/select&gt;
                      &lt;/div&gt;
                      &lt;div class="col-lg-3 col-sm-6"&gt;
                          &lt;select name="price" &gt;
                                  &lt;option value="any"&gt;All&lt;/option&gt;
                                  &lt;option value="500"&gt;A – 0 – 500 $&lt;/option&gt;
                                  &lt;option value="1000"&gt;B – 500 – 1000 $&lt;/option&gt;
                                  &lt;option value="2000"&gt;C – 1000 – 2000 $&lt;/option&gt;
                                  &lt;option value="3000"&gt;D – 2000 – 3000 $&lt;/option&gt;
                                  &lt;option value="4000"&gt;E – Trên 4000 $&lt;/option&gt;
                              &lt;/select&gt;
                        &lt;/div&gt;
                      &lt;div class="col-lg-3 col-sm-6"&gt;
                          &lt;input value="Search" type="submit" /&gt;
                      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This is the Controller:</p>
  
  <pre><code>public IEnumerable&lt;TourSummaryDto&gt; GetSearchTours(string destination, int? duration, int? price)
  {
          var query = _tourItemRepository.GetAll();
  
          return
              ConvertToTourSummaryDtoQuery(
                  query.Where(p =&gt; p.Category.Name.ToUpper() == destination.ToUpper() &amp;&amp;  p.TourContent.Giagoc &gt; 500 &amp;&amp; p.TourContent.Soluongngay &lt; 15).OrderByDescending(t =&gt; t.CreatedDate));
  }
  </code></pre>
  
  <p>How to Search with <code>Destination = any</code> or <code>Destination = something And Duration = all</code> or <code>Duration = something AND Price = all or Price = somethings</code></p>
  
  <p>How to Search with all of them ( Destination and Duration and Price )</p>
  
  <p>Any help is appreciated.</p>