title: Linq: how to exclude condition if parameter is null
body: <p>I have some table and the following condition of query: if parameter A is null take all, if not, use it in the query. I know how to do that in 2 steps:</p>
  
  <pre><code>List&lt;O&gt; list = null;
  if (A = null)
  {
      list = context.Obj.Select(o =&gt; o).ToList();
  }
  else
  {
      list = context.Obj.Where(o.A == A).ToList();
  }
  </code></pre>
  
  <p>Is it possible to have the same as one query?
  Thanks</p>