Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

View managers

Samuel Debruyn edited this page Dec 24, 2015 · 5 revisions

A view manager persists a single view (see Views) and forms the link between the event-driven view and another data model. Cirqus offers integrations with quite a few database systems to persist these views. It's also possible to have the same view in multiple view managers to duplicate data to another database system.

Cirqus has view managers for Entity Framework, MS SQL Server, MongoDB, HybridDb and more. It's recommended make yourself familiar with the characteristics of the view manager you choose. E.g. the Entity Framework view manager acts like EF code first, which means that complex typed properties cannot have null values.

Some examples

Let's say you have a view called MyView. To persist this view in MongoDB, you could use the following code:

var mongoDbMyViewManager = new MongoDbViewManager<MyView>("MongoDbConnectionString");

The view manager will start working as soon as you register it in an Event dispatcher with the Command Processor configuration API.

To load an instance of MyView, you could use this:

var instance = mongoDbMyViewManager.Load("IdOfTheInstance");

Note that the Delete() method on the view manager currently doesn't do anything in most view managers. Soft deletes are recommended.

Clone this wiki locally