Go to file
2021-02-05 11:59:53 -05:00
Demo this dosent work, but i will leave it here to explore later. 2021-02-05 11:59:53 -05:00
PoweredSoft.CQRS Add project files. 2021-02-01 23:31:07 -05:00
PoweredSoft.CQRS.Abstractions GQL Authorization Middleware implemented, will take care of controllers next. 2021-02-04 21:00:24 -05:00
PoweredSoft.CQRS.AspNetCore controller security with the same service. 2021-02-04 21:09: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 controller security with the same service. 2021-02-04 21:09:29 -05:00
PoweredSoft.CQRS.GraphQL.Abstractions graphql fluent validation implementation with middleware. 2021-02-03 20:28:56 -05:00
PoweredSoft.CQRS.GraphQL.DynamicQuery GQL dynamic query :) 2021-02-04 13:51:31 -05:00
PoweredSoft.CQRS.GraphQL.FluentValidation graphql fluent validation implementation with middleware. 2021-02-03 20:28:56 -05:00
PoweredSoft.CQRS.GraphQL.HotChocolate this dosent work, but i will leave it here to explore later. 2021-02-05 11:59:53 -05:00
PoweredSoft.CQRS.GraphQL.HotChocolate.DynamicQuery GQL Authorization Middleware implemented, will take care of controllers next. 2021-02-04 21:00:24 -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 GQL dynamic query :) 2021-02-04 13:51:31 -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>();
}