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 6089355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:05:25+00:00 2026-05-23T12:05:25+00:00

I am fairly certain that this is a lazy loading issue, but after reading

  • 0

I am fairly certain that this is a lazy loading issue, but after reading about lazy loading, I am still no closer to a solution. I have tried turning lazy loading on and off with no success. When I pull a Node from the database, the Parent and Children are null, even though such objects exist in the database.

I also added the ‘IsReference = true’ as an attempt to solve this issue.

I made the data members that are object references virtual at one point but I had serialization issues with the proxies.

DatabaseContext.cs

public class DatabaseContext : DbContext
{
  public DatabaseContext() : base("DatabaseName")
  {
    Configuration.LazyLoadingEnabled = false;
  }
  public DbSet<Node> Nodes { get; set; }
}

Node.cs

[DataContract(IsReference = true)]
public partial class Node
{

  [DataMember]
  public long ID { get; private set; }

  [DataMember]
  public Node Parent { get; set; }

  [DataMember]
  public ICollection<Node> Children { get; set; }

}
  • 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-23T12:05:26+00:00Added an answer on May 23, 2026 at 12:05 pm

    I ended up passing the includes I wanted as parameters (you can use actual types or strings) to the method, and then I looped the includes since they return DbQuery objects and don’t actually query the database. Thanks for the input @moi_meme (+1).

    foreach (var include in includes)
    {
      query = query.Include(include);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm fairly certain that this isn't possible but I thought I'd ask. The iPhone
I have a feeling that this probably is not possible using strictly CSS, but,
I'm fairly certain that it shouldn't matter since the graphics card is still executing
A fairly simple question for which I have a guess, but I can't find
I have a fairly small MySQL database (a Textpattern install) on a server that
So, my problem is this. I have a legacy MySQL database that I'm building
Since Squeak is purely Object Oriented I'm fairly certain that you should be able
I have a set of operations that are very expensive but are all pretty
I have a XML Structure that looks like this. <sales> <item name=Games sku=MIC28306200 iCat=28
I run a fairly active student blog that uses this event calendar plugin to

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.