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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:53:12+00:00 2026-05-31T03:53:12+00:00

Lets have theese objects: public class Obj1 { public string Id { get; set;

  • 0

Lets have theese objects:

public class Obj1
{
    public string Id { get; set; }
}

public class Obj2
{
    public string Id { get; set; }
    public string Obj1Id { get; set; }
}

public class Obj3
{
    public string Id { get; set; }
    public string Obj2Id { get; set; }
}

I use include like this:

var objs3 = session.Query<Obj3>()
    .Customize(x => x.Include<Obj3>(o3 => o3.Obj2Id))
    .Take(1000)
    .ToList();
foreach (var obj3 in objs3)
{
    var obj2 = session.Load<Obj2>(obj3.Obj2Id);
    //do something with it
}

My question is, is there possibility to add to query something like .Where(o2 => o2.Obj1Id == “some/Id”)? Query knows nothing about Obj2 on the client (Linq) side, but server side works with them, because this makes only one request to the DB.

I try to look how to works indexes and projections, but no luck with some constructions. Maybe my view is deformed from relational databases and there are other solutions, that need my structures to be redefined…

My other solution is to add Obj1Id to Obj3, but that will makes duplicites (I can live with this 😉 )

Some extra info to objects:
– Obj1 is unique for each customer, so there is about 200 documents
– Obj2 : Obj3 is 1 : 1 siblings, each with own point of view properties, both about 100.000 for each customer

Bonus question: Is there something like Inclide chaining? Including Obj1 inside of Including Obj2? (this I won’t use, is just question)

  • 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-31T03:53:13+00:00Added an answer on May 31, 2026 at 3:53 am

    No, you can’t add condition to the include.
    It is either all the way in, or not at all.

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

Sidebar

Related Questions

So lets say I have these classes: public class Person { public string Name
Given class: class SomeClass { public int intdata {get;set;} public string stringdata {get;set;} public
Lets say have this immutable record type: public class Record { public Record(int x,
Lets say I have the following code: public class Base { // Some stuff
Lets say I have these classes: class Foo { public $_data; public function addObject($obj)
In PHP I know many people will use a class to SET and GET
Let's say we have these two classes: public class Base { public static int
Lets say I have this code: <?php class hello { var $greeting = hello;
Let's say we have a class that looks like this: class A { public:
Lets say you have various objects of arbitrary type that you would like 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.