Linq to Entities SQL Multiple LIKE statements <p>I have to search an Entity by some values, the ones empty I don't have to consider them but the others I have to use a LIKE statement using Linq to Entities.</p> <p>The result I want to obtain should be similar to this SQL,</p> <pre><code>... WHERE (@taxid = '' OR m.taxid LIKE @taxid + '%') AND (@personalid = '' OR m.personalid LIKE @personalid + '%') AND (@certificate = '' OR m.certificate LIKE @certificate + '%') </code></pre> <p>My Linq to Entities looks like:</p> <pre><code>persons = context.Persons.Where(e =&gt; e.TaxId.Contains(taxId) &amp;&amp; e.PersonalId.Contains(personalId) &amp;&amp; e.Certificate.Contains(certificate)).ToList(); </code></pre> <p>Any clue?</p>