Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 828701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:45:56+00:00 2026-05-15T03:45:56+00:00

I have a model which includes NODES, and RELATIONSHIPS (that tie the nodes together,

  • 0

I have a model which includes NODES, and RELATIONSHIPS (that tie the nodes together, via a parent_node, child_node arrangement).

Q1 – Is there any way in EF / Linq-to-entities to perform a query on nodes (e.g. context.Nodes..) to find say “all parents” or “or children” in the graph?

Q2 – If there’s not in Linq-to-entities, is there any other way to do this other than writing a method that manually goes through and doing it?

Q3 – If manual is the only way to do it, should I be concerned about the number of database hits that will be going out to the database as the method keeps recursing through the data? Or more specifically, is there any EF caching type feature that might assist here in ensuring the method is performance from a “number of database hits” point of view?

thanks

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T03:45:57+00:00Added an answer on May 15, 2026 at 3:45 am

    There is no such elegant way to flaten a tree.
    you can (in stored proc or in entity framework) create a loop that will run untill no change happend, in which iteration you will bind parent and child’s child in some temp table or collection.
    in the end you will have a collection of parents, sucsessor two-ples.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ActiveRecord Appointment model, which includes topic and time attributes. I would
Using Symfony 1.4.5 with Doctrine I have a model which includes an uploaded image
In my app, I have a User model, which includes a number of attributes
I have a model which includes a module. I'd like to override the model's
I have a Django application which includes a custom model field (and accompanying form
I have a Model Formset that should take files sent via POST and add
I have a Person model, which includes a property representing the data of birth
I have a Post model which includes a date_published. I want to display links
I have a core data model which includes an entity with a to-many relationship.
I have model Foo which has field bar. The bar field should be unique,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.