daily pastebin goal
85%
SHARE
TWEET

Untitled

a guest Jan 12th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Entity Framework Join doubts with generated SQL
  2. Dim result = From p In DbContext.TblParent Join c In DbContext.TblChilds _
  3.              On c.idparent Equals p.id Where c.field1 = 1 And c.field2 = 2 Select p
  4.    
  5. Dim result = From p In DbContext.TblParent From c In p.TblChilds Where c.field1 = 1 And c.field2 = 2 Select p
  6.    
  7. SELECT
  8. [Extent1].[id] AS [id],
  9. [Extent1].[field1] AS [field1],
  10. [Extent1].[field2] AS [field2],
  11. [Extent2].[field1] AS [field1],
  12. [Extent2].[field2] AS [field2],
  13. [Extent2].[idparent] AS [idparent]
  14. FROM  [dbo].[TblParent] AS [Extent1]
  15. INNER JOIN (SELECT
  16.       [TblChilds].[field1] AS [field1],
  17.       [TblChilds].[field2] AS [field2],
  18.       [TblChilds].[idparent] AS [idparent]
  19.       FROM [dbo].[TblChilds] AS [TblChilds]) AS [Extent2] ON [Extent1].[id] = [Extent2].[idparent]
  20. WHERE ([Extent2].[field1] = 1) AND ([Extent2].[field2] = 2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top