This project is read-only.

Reference documentation

This reference guide explains what the Ncqrs framework is, how it can help and how you can use it.

What is Ncqrs?

Ncqrs is a framework for .NET helps build scalable, extensible and maintainable applications by supporting developers apply the Command Query Responsiblity Segregation (CQRS) architectural pattern. It does so by providing an infrastructure and implementations for the most important building blocks for command handling and execution, domain modeling, event sourcing, domain events, denormalization and event storage. These building blocks help you to focus on the code that adds business value. They come with annotation, convention and configuration support and help you to write isolated and testable code.

When to use Ncqrs

Scotty said in Star Treck V "How many times do I have to tell you, the right tool for the right job!". Ncqrs isn't a the tool that is ideal for every job. Which means that not every application will benefit from Ncqrs. Simple CRUD based systems without much behavior will not benefit from it. But there is a wide variety of applications that do benefit from Ncqrs.

Applications will most likelly benefit from Ncqrs when they have one or more of the following characteristics:
  • Long life time
  • Need to be scalable
  • Contain a lot of business logic and behavior
  • Other application must be able to intergrate with it
  • Having multiple views on the data
  • Must have a audit log

Ncqrs is a framework for .NET that helps developers build scalable application that are build with highly optimized components. It supports a CQRS based architecture that addresses extra concerns in the architecture. It addresses that there are two important concerns in every application. That is that a user wants to retrieve information and wants to do things with an application. These concerns are so important that they have to by embedded in the heart of the architecture.

Running the sample application

Beside the Ncqrs framework itself, the project also contains a small sample application. This sample application gives you a nice overview of a project that contains all the main elements of the (n)cqrs based application. It contains a command service, domain, event store, event bus, denormalizer, and a simple read model.

Steps to get it running

To run the sample application you need Visual Studio 2010 and Code Contracts. If you have that installed, it will not take you more than 5 minutes to get the sample application running; otherwise, I'll buy you a beer!

Get and build the source

  1. First download the latest version of the source code here and unpack.
  2. Open the solution Ncqrs.sln that is located in the /trunk/src/ directory.
  3. After the solution opened you should compile the solution.
  4. Make sure everything compiled correctly and that there where no build errors.

Get and run MongoDB

  1. Download MongoDB 1.4.0 for windows here.
  2. Unpack all the content in the bin folder to c:\mongodb\.
  3. Create the following folder c:\data\db
  4. Start a Command Shell (cmd.exe) and cd to c:\mongodb\.
  5. Now enter mongod.exe and hit enter.

Run it!

  1. Set Sample.UI as startup project.
  2. Now you can just run the Sample.UI by hitting F5 in Visual Studio.


  • Capt. Montgomery 'Scotty' Scott, Star Trek V: The Final Frontier

Last edited May 5, 2010 at 7:05 PM by pjvandesande, version 11


No comments yet.