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

The Archive Base Latest Questions

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

Case can have many Replies and one User, Replies can have one Case and

  • 0

Case can have many Replies and one User, Replies can have one Case and one User, One User can have many Replies and many Cases.

ObjectSet <= Case Object (IDbSet)

ObjectSet.Include(x => x.User).Include(x => x.Replies).FirstOrDefault(x => x.Id == caseId);

But the User Object for each Reply are not included? Only the User object for Case is Included?

How would I include the User objects for the Replies too?

Thanks in advance!

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

    You could try something like that:

    ObjectSet.Include(x => x.User)
             .Include(x => x.Replies.Select(r => r.User))
             .FirstOrDefault(x => x.Id == caseId);
    

    If it doesn’t work, try to specify the include as a string:

    ObjectSet.Include(x => x.User)
             .Include("Replies.User")
             .FirstOrDefault(x => x.Id == caseId);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that ScrollView can have only one Child but in my case I
Using Rails 3.1.3. I have Accounts and Users. One Account can have many Users.
I have two tables, users and groups . A user can belong to many
I have this polymorphic association where a user can have many comments, a school
I have an app where users can sign up with Facebook, in which case
I can imagine one case, in which the input parameter could be NULL so
I have a nested Form A Crew can have many meetings, a Meeting can
I have this PHP case statement switch ($parts[count($parts) - 1]) { case 'restaurant_pos': include($_SERVER['DOCUMENT_ROOT']
I have a gridview with three columns of textboxes. It can have as many
Say we have this scenario: Artist ==< Album ==< Track //ie, One Artist can

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.