To begin using RavenDB we need to get a new instance of the DocumentStore
object, which points to the server and acts as the main communication channel manager.
Once a new instance of DocumentStore
has been created, the next step is to create a new session against that Document Store. The session
object is responsible for implementing the Unit of Work pattern. A Unit of Work keeps track of everything you do during a business transaction that can affect the database. When you’re done, it figures out everything that needs to be done to alter the database as a result of your work.
The session
object is used to interact with RavenDB and provides a fully transactional way of performing database operations, and allows the consumer to store data into the database, and load it back when necessary using queries or by document ID.
In order to perform an action against the RavenDB store, we need to ensure that we have an active and valid RavenDB session before starting the action...