title: Linq with null parameters not working
body: <p>I don't understand why this query is not working, can you please help me? </p>
  
  <pre><code> public static IEnumerable&lt;SelectListItem&gt; MyList(int? id, string name="")
  {
   var list =db.Entity
      .Where(p=&gt;
            (name==null? p.Name !=null : p.Name==name) &amp;&amp; 
            (id.hasValue || p.Id==id)
      .Select(n=&gt;new SelectListItem()
            {
             Text=n.Name,
             Value=n.Id.ToString()
            }).ToList();
  return list;
  }
  </code></pre>
  
  <p>I want to have the full list when both parameters are null!! but I get an empty list when both parameters are null. </p>
  
  <p>The snippet code is from a big method which contain several query like this one. </p>