Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RandomDto
- {
- public int Id {get;set;}
- public ChildDto FirstChild {get;set;}
- public ChildDto SecondChild {get;set;}
- }
- SELECT CASE
- WHEN [dtoRandom].[FirstChild_FK] IS NULL
- THEN CAST(1 AS BIT) ELSE CAST(0 AS BIT)
- END, [t0].[Child_Description]
- END, [dtoRandom].[Id]
- FROM [Randoms] AS [dtoRandom]
- INNER JOIN (
- SELECT [s].*
- FROM [Childs] AS [s]
- ) AS [t0] ON [dtoRandom].[FirstChild_FK] = [t0].[Id]
- .ProjectTo<RandomDto>(null, "FirstChild", "SecondChild")
- .ProjectTo<RandomDto>(x=>x.FirstChild, x=>x.SecondChild)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement