title: perform join using EF5 and a Table-Valued Function (TVF)?
body: <p>I have tried this in EF 4.3 to no avail.
  EF5 (in conjunction with .NET 4.5) now supports TVFs.
  So in theory this new EF5 feature would save me a whole load of work if the following were possible.</p>
  
  <p>SQL Query;</p>
  
  <pre><code>SELECT O.*
  FROM dbo.Orders O
  INNER JOIN dbo.SecurityTVF(@Name)   S   ON  S.UserID=O.UserID
  </code></pre>
  
  <p>Equivalent EF5 Query - possible?;</p>
  
  <pre><code>using (var context = new DSN())
  {
      // Return all the orders - limited by those the current user has placed
      var orders = from o in context.Orders
                   join s in context.SecurityTVF(HttpContext.Current.User.Identity.Name) on o.UserID equals s.UserID
                   select o;
  }
  </code></pre>
  
  <p>I don't really want to go upgrade all the software at this stage, unless the above is going to be possible in EF5... anyone tried this yet?</p>
  
  <p>NB: The official documentation is a bit basic, <a href="http://msdn.microsoft.com/en-us/data/hh859577.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/data/hh859577.aspx</a></p>
  
  <p>Thanks in advance!</p>