Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get an entity including all child documents #164

Open
MrGorki opened this issue Dec 14, 2016 · 1 comment
Open

How to get an entity including all child documents #164

MrGorki opened this issue Dec 14, 2016 · 1 comment

Comments

@MrGorki
Copy link

MrGorki commented Dec 14, 2016

Indexing is done!
But now I am implementing a search mechanism but I want to make query on top of child documents also.

So, is there anyway to bring the entity with all child documents (something like lazy load)

For example I have a model like below:

public class Entity1 {
   public int Id {get; set;}
   public string Name {get; set; }
   public virtual Entity2 Related {get; set;}
}

public class Entity2 {
   public int Id {get; set; }
   public string Name {get; set; } 
} 

And I want to do a query like:

var results = _context.Where(m=>m.Entity2.Name == "George").ToList();

I want to list Entity1 but looking for an attribute of the child.

Is this possible?

@MrGorki
Copy link
Author

MrGorki commented Dec 14, 2016

From other perspective;

Is it possible to load the child documents also with the entity itself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant