title: LINQ to Entities does not recognize the method 'System.String Decrypt(System.String, System.String)' method
body: <p>I am trying to display email in <code>combobox</code> by filtering using email. My problem is that my data is encrypted in the users table.</p>
  
  <p>When I am trying to decrypt it it giving this error:</p>
  
  <blockquote>
    <p>LINQ to Entities does not recognize the method 'System.String Decrypt(System.String, System.String)' method, and this method cannot be translated into a store expression</p>
  </blockquote>
  
  <p>How can I solve this error?</p>
  
  <p><strong>Here is my Lookup class</strong></p>
  
  <pre><code>    public class Lookup
      {
          public long boundvalue { get; set; }
          public string boundtext { get; set; }
      }
  </code></pre>
  
  <p><strong>Here is my code to filter</strong></p>
  
  <pre><code>    public IEnumerable&lt;Lookup&gt; getUser(string fText)
              {
                  var ret = new List&lt;Lookup&gt;
                                {
                                    new Lookup
                                        {
                                            boundvalue = 0,
                                            boundtext = ""
                                        }
                                };
                  if (!string.IsNullOrEmpty(fText))
                  {
                      ret.AddRange(_entities.Users.Where(x =&gt;EncDec.Decrypt(x.UserVar01.Trim().Replace("_",string.Empty), 
                      Enums.EncDecSecKeyToString(Enums.EncDecSecKey.Email)).Contains(fText.Trim()))
                                   .Select(select =&gt; new Lookup
                                   {
                                       boundvalue = select.UserID,
                                       boundtext = EncDec.Decrypt(select.UserVar01.Trim().Replace("_", string.Empty),
                                       Enums.EncDecSecKeyToString(Enums.EncDecSecKey.Email)),
                                   }));
  
                  }
                  return ret;
              }
  </code></pre>