title: How to map CONTAINSTABLE function in Entity Framework (code-first)?
body: <p>Thanks to <a href="https://codefirstfunctions.codeplex.com/" rel="nofollow noreferrer">https://codefirstfunctions.codeplex.com/</a>, it is now possible to map functions in Entity Framework (code-first). I am trying to map <a href="http://technet.microsoft.com/en-us/library/ms189760.aspx" rel="nofollow noreferrer">CONTAINSTABLE function</a>. How can pass the <code>table</code> argument?</p>
  
  <p>It might be good to use generic for that:</p>
  
  <pre><code>db.ContainsTable&lt;MyEntity&gt;(myTerm)
  </code></pre>
  
  <p>could translate into:</p>
  
  <pre><code>SELECT * FROM CONTAINSTABLE(MyEntities, *, @myTerm)
  </code></pre>
  
  <p>Should I somehow use <a href="http://msdn.microsoft.com/en-us/library/bb339670%28v=vs.110%29.aspx" rel="nofollow noreferrer">CreateQuery</a> for that?</p>
  
  <p>(There are some older tries: <a href="https://stackoverflow.com/questions/18746127/a-composable-full-text-search-with-a-code-first-model">[1]</a> and hacky <a href="https://stackoverflow.com/a/19644900/121968">[2]</a>. But with EF 6.1 and CF functions I am trying to find something more clean.)</p>