O'Reilly logo

RavenDB 2.x Beginner's Guide by Khaled Tannir

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – using Include to reduce query calls

Now let's take a look at how to handle document relationships while reducing query calls. You will make a call to the Load() method and the Include() method on the Session object to retrieve a City from the Cities collection and preload the Country referenced by the City.CountryId field. Then you will take a look at the RavenDB log and analyze its entries.

  1. Open the RavenDB_Ch06 project in Visual Studio.
  2. Copy the City class you created previously and make it a part of the RavenDB_Ch06 project.
  3. Add the following code snippet to the Main() method:
    Time for action – using Include to reduce query calls

    Tip

    You can specify more than one ID in the Load() method. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required