title: ASP.NET MVC How to use DbSet with multiple conditions
body: <p>I have a Person model in ASP.NET MVC, and I'm working with DbContext, and I have
  a DbSet to this model.
  I have first name, last name, nick name fields.
  I want to know how can I select persons with DbSet with <em>several</em> conditions.</p>
  
  <p>If it was SQL, I want to do this:</p>
  
  <pre><code>select * from persons where firstName like '%something%' and
  lastName like '%something%' and
  nickName like '%something%';
  </code></pre>
  
  <p>How can I do it with DbSet?
  I have the next code:</p>
  
  <pre><code>    public ActionResult SearchPerson([Bind(Include = "Id,FirstName,LastName,NickName")] Person person)
      {
          DbSet&lt;Person&gt; result = db.Persons;
          if (!String.IsNullOrEmpty(person.FirstName))
          {
              result.Where(x =&gt; x.FirstName.Contains(person.FirstName));
          }
  
          if (!String.IsNullOrEmpty(person.LastName))
          {
              result.Where(x =&gt; x.LastName.Contains(person.LastName));
          }
  
          if (!String.IsNullOrEmpty(person.NickName))
          {
              result.Where(x =&gt; x.NickName.Contains(person.NickName));
          }
  
          return View(result.ToList());
      }
  </code></pre>
  
  <p>It seems the is no AND clause or any WHERE clause between
  the conditions, and result.ToList() gives me ALL the results from the DB.
  Any help?</p>