title: InvalidOperationException: An exception was thrown while attempting to evaluate a LINQ query parameter expression
body: <p>I have a problem, in the source code, a query LINQ. After upgrading to .net core 3.1 from 2.2.</p>
  <pre><code>    public IQueryable&lt;Data.Model.Content&gt; GetAll()
      {
          return dbContext.Content.Include(a =&gt; a.ContentTemplate);
      }
  
      public bool ExistsSlug(int id, string name)
      {
          return GetAll()
              .Any(x =&gt; x.Name.ToLower() == name.ToLower() &amp;&amp; x.Id != id);
      }
  </code></pre>
  <p><strong>Error :</strong></p>
  <pre><code>NullReferenceException: Object reference not set to an instance of an object.
  
  lambda_method(Closure )
  
  InvalidOperationException: An exception was thrown while attempting to evaluate a LINQ query parameter expression. To show additional information call EnableSensitiveDataLogging() when overriding DbContext.OnConfiguring.
  
  Microsoft.EntityFrameworkCore.Query.Internal.ParameterExtractingExpressionVisitor.GetValue(Expression expression, out string parameterName)
  
      return GetAll().Any(x =&gt; x.Name.ToLower() == name.ToLower() &amp;&amp; x.Id != id);
  
  System.Linq.Queryable.Any&lt;TSource&gt;(IQueryable&lt;TSource&gt; source, Expression&lt;Func&lt;TSource, bool&gt;&gt; predicate)
  
  lambda_method(Closure , object , object[] )
  
  Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(object target, object[] parameters)
  </code></pre>