title: Method that contains linq not working inside another linq
body: <p>I am currently being bothered by calling a method inside a linq whic is merely like this:</p>
  
  <pre><code>var entity=GetCustomers(false).Where(a =&gt; GetListCompcd(userlinkcd, rolecd).Any(b =&gt; b == a.comp_cd));
  </code></pre>
  
  <p>the GetListCompcd method:</p>
  
  <pre><code>private List&lt;string&gt; GetListCompcd(string userlinkcd, string rolecd)
      {
          List&lt;string&gt; listcompcd = new List&lt;string&gt;();
          if (rolecd == GeneralConst.L_ROLE_AGENT_CD)
          {
              listcompcd.Union(_unitOfWork.Repository&lt;CONTACT&gt;().Query().Filter(a =&gt; a.agent_cd == userlinkcd).Get().Select(a =&gt; a.comp_cd).ToList());
              listcompcd.Union(_unitOfWork.Repository&lt;AGENT_2D&gt;().Query().Filter(a =&gt; a.agent_cd == userlinkcd).Get().Select(a =&gt; a.comp_cd).ToList());
          }
          else if (rolecd == GeneralConst.L_ROLE_CGROUP_CD)
          { listcompcd.AddRange(_unitOfWork.Repository&lt;CONTACT&gt;().Query().Filter(a =&gt; a.agent_cd == userlinkcd).Get().Select(a =&gt; a.comp_cd).ToList()); }
          return listcompcd;
      }
  </code></pre>
  
  <p>this code has a error saying</p>
  
  <pre><code>LINQ to Entities does not recognize the method 'System.Collections.Generic.List`1[System.String] GetListCompcd(System.String, System.String)' method, and this method cannot be translated into a store expression.
  </code></pre>