Skip to content
forked from sputier/CQELight

CQELight is an entreprise grade extensible and customisable framework for creating software with CQRS, DDD & Event Sourcing patterns

License

Notifications You must be signed in to change notification settings

nozzle-1/CQELight

 
 

Repository files navigation

CQELight

Documentation is available at : https://cqelight.readthedocs.io

Build Status Documentation Status

Description

CQELight is an entreprise grade extensible and customisable framework for creating softwares with DDD, Command Query & Event Sourcing.

DDD, CQRS and Event-sourcing are great topics, but it's not always easy to get started with them. Here's where CQELight is.

CQELight allows you to do clean loosely coupled architecture for your software developpments. Like this, you won't have to worry about technical stuff, just focus on business stuff and rely on CQELight system to help you build and run your system.

Based on Domain Driven Design, you can create your objects within boundaries, as aggregates, entities or value objects. With this clean object architecture, you can perform simple, flexible and extensible CQRS operations for interact with the system.

Moreover, CQELight bundle a bunch of tools used in all entreprise-grade projects such as IoC or Data Access Layer, among other things.

Available packages :

Extension name Stable
CQELight NuGet
AspNetcore NuGet
InMemory Bus NuGet
RabbitMQ Bus NuGet
Azure Service Bus NuGet
Autofac IoC NuGet
Microsoft Extensions DependencyInjection IoC NuGet
MongoDb EventStore NuGet
EF Core EventStore NuGet
EF Core DAL NuGet
MongoDb DAL NuGet
TestFramework NuGet
MVVM NuGet
MVVM - MahApps implementation NuGet

Quick getting started - The 'Hello World!' example

To get really quick started, create a new console application

dotnet new console

Edit your csproj to use latest C# version

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <LangVersion>latest</LangVersion>
  </PropertyGroup>

</Project>

Add CQELight & CQELight.Buses.InMemory packages

dotnet add package CQELight | dotnet add package CQELight.Buses.InMemory

Create a new class GreetingsEvent.cs and add the following content

using CQELight.Abstractions.Events;
namespace HelloWorld.Events
{
    class GreetingsEvent : BaseDomainEvent
    {
    }
}

Create a new class GreetingsEventHandler.cs and add the following content

using CQELight.Abstractions.Events.Interfaces;
using CQELight.Abstractions.DDD;
using HelloWorld.Events;
using System;
using System.Threading.Tasks;

namespace HelloWorld.Handlers
{
    class GreetingsEventHandler : IDomainEventHandler<GreetingsEvent>
    {
        public Task<Result> HandleAsync(GreetingsEvent domainEvent, IEventContext context = null)
        {
            Console.WriteLine("Hello world!");
            return Result.Ok();
        }
    }
}

Modify Program.cs as following

using CQELight;
using CQELight.Dispatcher;
using HelloWorld.Events;
using System;
using System.Threading.Tasks;

namespace HelloWorld
{
    class Program
    {
        static async Task Main(string[] args)
        {
            new Bootstrapper()
                .UseInMemoryEventBus()
                .Bootstrapp();

            await CoreDispatcher.PublishEventAsync(new GreetingsEvent()).ConfigureAwait(false);

            Console.Read();
        }
    }
}

Then, execute dotnet run, Hello World! should be visible on console

About

CQELight is an entreprise grade extensible and customisable framework for creating software with CQRS, DDD & Event Sourcing patterns

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%