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(); +} +``` +