title: Build a linq query based on specific criteria c#
body: <p>I have a List ListPeople "list of people named ListPeople" and the class for an object People is:</p>
  
  <pre><code>class People
  {
     public string Name {get;set;}
     public DateTime Dob {get;set;}
     public int Wieght {get;set;}
  }
  </code></pre>
  
  <p>How could I perform a search with criteria chosen by user: Something like:
  <img src="https://i.stack.imgur.com/57p0S.png" alt="enter image description here"></p>
  
  <p>for example if the user would chose something like:
  <img src="https://i.stack.imgur.com/RDilT.png" alt="enter image description here"></p>
  
  <p>Then I would know how to set up that query:</p>
  
  <pre><code>var query = (from a in ListPeople
               where a.Name == "Tom" &amp;&amp;
               a.Weight &gt; 25 &amp;&amp;
               a.Dob &lt; "dateTime.Now() - 7 months" // you know what I mean
               select a).ToList();
  </code></pre>
  
  <p>do I have to build 4*4*4 (all posible combinations) number of queries? </p>