-
Notifications
You must be signed in to change notification settings - Fork 239
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
Lambda expression for multiple Include #41
Comments
Hi @ovation22, Sure, you can do that. Just start with
It doesn't matter in which order you define the statements, or if you use chaining, or if you writing everything in separate statements. Whatever you add through the builder (named as Examples:
The same can be written with all separate statements:
|
Ah, ok, that makes sense. Thank you so much! |
Hello @fiseni Query.Where(x => x.Name == "Something")
.Paginate(10, 20)
.Include(x => x.SomeProperty1)
.ThenInclude(x => x.SecondLevelProperty1)
.Include(x => x.SomeProperty1)
.ThenInclude(x => x.SecondLevelProperty2); |
Hey @ShadyNagy Yes, that's the correct way of doing it. Even when working with EF directly, you still have to do it that way, starting from the main navigation once again. PS. This issue is old, At that time we couldn't use |
@fiseni Thanks so much |
Hi Steve,
I appreciate all the work on this that you (and community) have put into this.
Is it possible to have multiple includes using expression syntax? I was able to chain includes using string then expression, but would really like to use the typed expressions if possible.
Expected behavior:
Query.Include(x => x.foo).Include(x => x.bar)
should compile and produce the same results as:
Query.Include("foo").Include(x => x.bar)
I'm happy to look into what it would take and will try to spend some time with it this weekend.
The text was updated successfully, but these errors were encountered: