-
Book Overview & Buying
-
Table Of Contents
RavenDB 2.x Beginner's Guide
By :
Let's take a look and learn how to create a new index by inheriting from the AbstractIndexCreationTask class. To create the index we will create a new project and add a new class that inherits from this class. The index definition is very easy and will contain only one Map function that retrieves the CountryId key. To get all cities in the USA, we will query the index and filter the result. Once the index is created you will execute it in Management Studio and view the result.
Start Visual Studio, create a new project and name it RavenDB_CH05.
Use the NuGet Package Manager to add a reference to the RavenDB Client.
We need to use the City and Country classes created in the previous chapter, you may make a copy into this project or create a new one.
Add a new class to the project, name it City and complete it with the following code snippet:

Add a new class to the project, name it Country and complete it with the following...
Change the font size
Change margin width
Change background colour