title: Checking if List is Null inside LINQ to SQL query?
body: <p>I have a List lstStudents = GetStudents() //this method can return null.
  Now I am trying to run this query on my DB table student,</p>
  
  <pre><code>var result = (from c in student
               where lstStudents.Contains(c.name)
               select c);
  </code></pre>
  
  <p>How do I check if lstStudents is not null inside the query.</p>
  
  <p>Note: I know I can check it before this query is run but I cannot do that for some other reason. And if I try (lstStudents!=null) inside query it errors out.</p>
  
  <blockquote>
    <p>Cannot compare elements of type
    'System.Collections.Generic.List`1[[System.String, mscorlib,
    Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'.
    Only primitive types, enumeration types and entity types are
    supported.</p>
  </blockquote>
  
  <p>Any help is appreciated.</p>