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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:10:57+00:00 2026-05-19T04:10:57+00:00

I have 2 POCO classes like Category and Parent. In my conceptual model, I

  • 0

I have 2 POCO classes like Category and Parent. In my conceptual model, I have a navigation property from Parent to Category, but not the other way around (from Category to Product).

I have been able to successfully create a Product and assign a Category to it and save the changes, like:

Product p = new Product();
p.Category = someCategory; 
context.SaveChanges();

However, when I load Products, Category is property NULL. Any advice?

Cheers,
Mosh

  • 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-19T04:10:57+00:00Added an answer on May 19, 2026 at 4:10 am

    Try eager loading the Category when you retrieve the Product:

    var product = ctx.Products.Single(x => x.ProductId == 1).Include("Category");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Poco-Model using abstract classes, and it seems not to work
Say I have the following POCO classes: public class Parent { public int ID
I have read some articles on POCO in the enttity framework but still don't
it seems like in my model folder, all of my classes fits into one
Following the way Rob does it, I have the classes that are generated by
I'm a little confused here. I have my POCO classes created with the entity
Do you have any insights into the most elegant way of persisting objects from
I'm using the MVVM pattern and I have a POCO (in my Model) with
I have a data model like this in SQL Server: table Note - varchar
Say I have the following POCO classes: public class AuditableModel { public int ID

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.