There are cases when we need to retrieve multiple document results to perform a given operation. RavenDB optimizes this scenario by sending multiple requests in a single round trip to the server. To do this, RavenDB adds a
Lazily() method to instruct the client to only issue the query when the data is actually accessed. When the data is needed, the requests are batched into a single multi-get request.
Let's say we have a page where we want to display the name of our Wiki space, followed by all of the pages tagged with architecture. This requires a load and a query. Take a look at the following code example to see how the
Lazily() method is introduced to delay the server execution:
var space = session.Advanced.Lazily.Load<Space>("space/1"); ...