Now that you have prepared the shard infrastructure for the ShardRavenDB
application, you are now ready to create it and learn how to create and populate shards. Once the application is created, you will run it and then observe and analyze the RavenDB logs:
In Visual Studio, create a new
Console Application
and name itShardRavenDB
.Add the
RavenDB Client
reference to the application using theNuGet
package manager.Add a new class, name it
City
, and complete it using the following code snippet:Add a new class, name it
Country
, and complete it using the following code snippet:Add a new class, name it
Shards
, and complete it using the following code snippet:Add the
Shards
class constructor and destructor then complete them as shown in the following code snippet:Add a new class, name it
PopulateShards
, and complete it using the following code snippet:Add the
AddDocumentsToShards()
method to thePopulateShards
class and complete...