title: Unable to use certain functions with LINQ to Entities?
body: <p>I'm trying to implement a search feature on a project using LINQ queries. Because the data sometimes contains characters with accents and other symbols, I created a method to remove these for the search.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>var addresses = (from a in db.Addresses
                   join b in db.Addresses on a.ClientID equals b.ClientID
                   where a.AddressType == 1 &amp;&amp; b.AddressType == 2
                   select new
                   {
                       /* Columns selected */
                   });
  var q = (from e in db.Employers
           join a in addresses on e.EmployerID equals a.id
           join i in db.IndustrialSectors on e.IndustrialSector equals i.ID
           select new
           {
               /* Columns selected */
           });
  
  if (search != "")
  {
      q = (from i in q
           where (
             Util.StringUtil.RemoveDiacritics(i.entity.ToString().ToLowerInvariant()).Contains(search) ||
             Util.StringUtil.RemoveDiacritics(i.name.ToString().ToLowerInvariant()).Contains(search)
           )
           select i);
  }
  </code></pre>
  
  <p>It generates an exception saying that LINQ to Entities does not recognize my method (RemoveDiacritics(String)).</p>