title: Error converting parameter in Linq query Entity Framework Core
body: <p>For SEO, I delete Turkish characters and spaces.</p>
  
  <p>But I can't format the LINQ parameter, 
  it gives the error.</p>
  
  <blockquote>
    <p>The LINQ expression 'DbSet
        .Where(p => p.ProductNameTR
            .trCharToEnChar() == __productName_0)' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See <a href="https://go.microsoft.com/fwlink/?linkid=2101038" rel="nofollow noreferrer">https://go.microsoft.com/fwlink/?linkid=2101038</a> for more information.</p>
  </blockquote>
  
  <pre><code>public List&lt;TEntity&gt; GetAll(Expression&lt;Func&lt;TEntity, bool&gt;&gt; filter = null)
  {
      TContext context = new TContext();
      return filter == null ?
          context.Set&lt;TEntity&gt;().ToList() :
          context.Set&lt;TEntity&gt;().Where(filter).ToList();
  }
  
  public static string trCharToEnChar(this string str)
  {
      var newStr = "";
      for (int i = 0; i &lt; str.Length; i++)
      {
          newStr = str.Replace(" ", "_");
          newStr = newStr.Replace("ı", "i");
          newStr = newStr.Replace("ö", "o");
          newStr = newStr.Replace("ü", "u");
          newStr = newStr.Replace("ğ", "g");
          newStr = newStr.Replace("ş", "s");
          newStr = newStr.Replace("ç", "c");
          newStr = newStr.Replace("ü", "u");
      }
  
      return newStr;
  }
  
  public List&lt;Products&gt; GetProductsByProductNameTextConvert(string productName)
  {
      return _productDal.GetAll(p =&gt; p.ProductNameTR.trCharToEnChar() == productName);
  }
  </code></pre>