From 0e240a80ab2a288d05949b0b42cd4ee5ddc3154f Mon Sep 17 00:00:00 2001 From: dlebee <36390643+dlebee@users.noreply.github.com> Date: Tue, 2 Feb 2021 12:41:38 -0500 Subject: [PATCH] Update README.md --- README.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0485422..c14d420 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,28 @@ Our implementation of query and command responsability segregation (CQRS). | PoweredSoft.CQRS.Abstractions | [![NuGet](https://img.shields.io/nuget/v/PoweredSoft.CQRS.Abstractions.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.CQRS.Asbtractions/) | ```PM> Install-Package PoweredSoft.CQRS.Abstractions ``` | | PoweredSoft.CQRS | [![NuGet](https://img.shields.io/nuget/v/PoweredSoft.CQRS.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.CQRS/) | ```PM> Install-Package PoweredSoft.CQRS ``` | | PoweredSoft.CQRS.AspNetCore.Abstractions | [![NuGet](https://img.shields.io/nuget/v/PoweredSoft.CQRS.AspNetCore.Abstractions.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.CQRS.AspNetCore.Abstractions/) | ```PM> Install-Package PoweredSoft.CQRS.AspNetCore.Abstractions ``` | -| PoweredSoft.CQRS.AspNetCore | [![NuGet](https://img.shields.io/nuget/v/PoweredSoft.CQRS.AspNetCore.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.CQRS.AspNetCore/) | ```PM> Install-Package PoweredSoft.CQRS.AspNetCore ``` | \ No newline at end of file +| PoweredSoft.CQRS.AspNetCore | [![NuGet](https://img.shields.io/nuget/v/PoweredSoft.CQRS.AspNetCore.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.CQRS.AspNetCore/) | ```PM> Install-Package PoweredSoft.CQRS.AspNetCore ``` | + + +## Sample of startup code for aspnetcore MVC + +```csharp +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(); +} +``` +