Go to file
2021-02-03 10:50:28 -05:00
Demo moved files individually. 2021-02-03 10:50:28 -05:00
PoweredSoft.CQRS Add project files. 2021-02-01 23:31:07 -05:00
PoweredSoft.CQRS.Abstractions dynamic query support. 2021-02-02 19:01:29 -05:00
PoweredSoft.CQRS.AspNetCore dynamic query support. 2021-02-02 19:01:29 -05:00
PoweredSoft.CQRS.AspNetCore.Abstractions cqrs. 2021-02-02 12:19:59 -05:00
PoweredSoft.CQRS.DynamicQuery better way to inject interceptors into the dynamic query. 2021-02-03 01:26:37 -05:00
PoweredSoft.CQRS.DynamicQuery.Abstractions better way to inject interceptors into the dynamic query. 2021-02-03 01:26:37 -05:00
PoweredSoft.CQRS.DynamicQuery.AspNetCore more adjusted to support params. 2021-02-02 19:32:39 -05:00
.gitattributes Add .gitignore and .gitattributes. 2021-02-01 23:31:05 -05:00
.gitignore Add .gitignore and .gitattributes. 2021-02-01 23:31:05 -05:00
azure-pipeline.yaml Create azure-pipeline.yaml 2021-02-01 23:34:07 -05:00
LICENSE Create LICENSE 2021-02-01 23:55:58 -05:00
PoweredSoft.CQRS.sln dynamic query support. 2021-02-02 19:01:29 -05:00
README.md Update README.md 2021-02-02 12:42:44 -05:00

CQRS

Our implementation of query and command responsability segregation (CQRS).

Getting Started

Install nuget package to your awesome project.

Full Version NuGet NuGet Install
PoweredSoft.CQRS.Abstractions NuGet PM> Install-Package PoweredSoft.CQRS.Abstractions
PoweredSoft.CQRS NuGet PM> Install-Package PoweredSoft.CQRS
PoweredSoft.CQRS.AspNetCore.Abstractions NuGet PM> Install-Package PoweredSoft.CQRS.AspNetCore.Abstractions
PoweredSoft.CQRS.AspNetCore NuGet PM> Install-Package PoweredSoft.CQRS.AspNetCore

Sample of startup code for aspnetcore MVC

public void ConfigureServices(IServiceCollection services)
{
    // make sure to add your queries and commands before the .AddPoweredSoftQueries and .AddPoweredSoftCommands
    AddQueries(services);
    AddCommands(services);

    // adds the non related to aspnet core features.
    services.AddPoweredSoftCQRS();
    
    services
        .AddControllers()
        .AddPoweredSoftQueries() // adds queries to aspnetcore mvc.(you can make it configurable to load balance only commands on a instance)
        .AddPoweredSoftCommands() // adds commands to aspnetcore mvc. (you can make it configurable to load balance only commands on a instance)
        .AddFluentValidation();

    services.AddSwaggerGen();
}

Example how to add your queries and commands.

private void AddCommands(IServiceCollection services)
{
    services.AddCommand<CreatePersonCommand, CreatePersonCommandHandler>();
    services.AddTransient<IValidator<CreatePersonCommand>, CreatePersonCommandValidator>();

    services.AddCommand<EchoCommand, string, EchoCommandHandler>();
    services.AddTransient<IValidator<EchoCommand>, EchoCommandValidator>();
}

private void AddQueries(IServiceCollection services)
{
    services.AddQuery<PersonQuery, IQueryable<Person>, PersonQueryHandler>();
}