Future Queries
Check out this video about Future Queries for some more information!
Widget Connector | ||||||
---|---|---|---|---|---|---|
|
...
Code Block | ||
---|---|---|
| ||
// build up multiple queries var q1 = db.User .ByEmailAddress("one@test.com") .Future(); var q2 = db.Task .Where(t => t.Summary == "Test") .Future(); // this triggers the loading of all the future queries var users = q1.ToList(); |
No data is retrieved until q1.ToList(); is executed. At that time, PLINQO knows to execute all the future queries automatically. The data is both batched and not retrieved until it is needed.
...
Code Block | ||
---|---|---|
| ||
var db = new TrackerDataContext(); // build up queries var q1 = db.User .ByEmailAddress("one@test.com") .Future(); var q2 = db.Task .Where(t => t.Summary == "Test") .Future(); // this triggers the loading of all the future queries var users = q1.ToList(); |
In the example above, there are 2 queries built up, as soon as one of the queries is enumerated, it triggers the batch load of both queries.
...
Does not support anonymous types.