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

Creating QueryTask #22002

Closed
aburakab opened this issue Aug 10, 2020 · 4 comments
Closed

Creating QueryTask #22002

aburakab opened this issue Aug 10, 2020 · 4 comments

Comments

@aburakab
Copy link

aburakab commented Aug 10, 2020

QueryTask will help us to do a single roundtrip for all queries.

var customersQueryTask = context.Customers.AsQueryTask();
var productsQueryTask = context.Products.AsQueryTask();

// One roundtrip to Database
await QueryTask.WhenAll(customersQueryTask, productsQueryTask);
var customer = customersQueryTask.Result;
var products = productsQueryTask.Result;

I'm not sure if we have something similar in the current version?

Updated:
Looks like the Future Queries Here are doing the same thing
https://entityframework-plus.net/query-future

@roji
Copy link
Member

roji commented Aug 10, 2020

Duplicate of #10879

@roji roji marked this as a duplicate of #10879 Aug 10, 2020
@roji
Copy link
Member

roji commented Aug 10, 2020

Executing multiple LINQ queries in a single batch/roundtrip is trakced by #10879.

Specifically for the code above, AsQueryTask isn't part of EF Core or standard .NET, where is it coming from? Note that EF Plus is a separate product that isn't maintained by the EF Core team.

@aburakab
Copy link
Author

aburakab commented Aug 10, 2020

It's just an Idea (AsQueryTask is not existed)! and I realized that it's called ".Future" in that Product.

@roji
Copy link
Member

roji commented Aug 10, 2020

OK, thanks for clarifying. This indeed looks like a duplicate of #10879.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants