Best practices to implement Advanced search using linq and Entityframework
<p>I am trying to build an advanced search in my application using LINQ and Entity framework depending on 10 parameters but the user have the ability to send one or more parameter for search. I tired to implement it like the below way but it didn't work instead of making if conditions and change the query every check.</p>

<p>So is there any simple way to use LINQ to select depending on the user inputs to match results exists?</p>

<pre><code>var data = (from item in db.Student
           where item.Firstname == fname
           &amp;&amp; item.Middlename == mname
           &amp;&amp; item.Lastname == lname
           &amp;&amp; item.Birthday == birthday
           &amp;&amp; item.Age == age
           &amp;&amp; item.AdmissionYear == year
           &amp;&amp; item.Grade == grade
           &amp;&amp; item.Address == Address
           &amp;&amp; item.Class == class
           &amp;&amp; item.Number == number
           select item).FirstOrDefault();
</code></pre>