Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive/Hierarchical query #50

Open
DevelPh opened this issue May 22, 2018 · 0 comments
Open

Recursive/Hierarchical query #50

DevelPh opened this issue May 22, 2018 · 0 comments

Comments

@DevelPh
Copy link

DevelPh commented May 22, 2018

Is there any way to select an item id and all its children ids with one query?

I have entity:

public class Comment
{
   public int Id {get;set;}
   public int ParentId {get;set;}
   public int Text {get;set;}
}

I have an ID, so I want to select Comment with ID and all its children with subchildren. Example:

1
-2
--3
-4
-5
--6
2
3

If ID == 1 then I want a list of 1,2,3,4,5,6.

I want to avoid using mulitple gets to achieve this result.

Grtz and thanks in advance,

Philippe Devel

philippe.devel@digipolis.be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant