Giter Club home page Giter Club logo

commandquery's Introduction

CommandQuery

build CodeFactor

CommandQuery CommandQuery.Abstractions

CommandQuery.AspNetCore CommandQuery.AWSLambda CommandQuery.AzureFunctions CommandQuery.GoogleCloudFunctions

CommandQuery.Client

Content

Introduction

Command Query Separation (CQS) for .NET and C#

  • Build services that separate the responsibility of commands and queries
  • Focus on implementing the handlers for commands and queries
  • Create APIs with less boilerplate code

Available for:

🌐 ASP.NET Core
⚡ AWS Lambda
⚡ Azure Functions
⚡ Google Cloud Functions

Command Query Separation?

Queries: Return a result and do not change the observable state of the system (are free of side effects).

Commands: Change the state of a system but do not return a value.

Martin Fowler

In other words:

  • Commands
    • Writes (create, update, delete) data
  • Queries
    • Reads and returns data

The traditional approach that commands do not return a value is a bit inconvenient.

CommandQuery has a pragmatic take and supports both commands with and without result 👍

Packages

CommandQuery ⚙️

NuGet NuGet

Command Query Separation for .NET

CommandQuery.AspNetCore 🌐

NuGet NuGet

Command Query Separation for ASP.NET Core

CommandQuery.AWSLambda

NuGet NuGet

Command Query Separation for AWS Lambda

CommandQuery.AzureFunctions

NuGet NuGet

Command Query Separation for Azure Functions

CommandQuery.GoogleCloudFunctions

NuGet NuGet

Command Query Separation for Google Cloud Functions

CommandQuery.Client 🧰

NuGet NuGet

Clients for CommandQuery APIs

Upgrading

⬆️ Upgrading from version 3.0.0 to 4.0.0

Upgrade AspNetCore:

  • Upgrade the project target framework to net8.0

Upgrade AWSLambda:

  • Upgrade the project target framework to net8.0

Upgrade AzureFunctions:

  • Upgrade the project target framework to net8.0
  • Remove the logger argument from HandleAsync
  • Consider to use the HttpRequest versions of HandleAsync

Upgrade GoogleCloudFunctions:

  • Upgrade the project target framework to net8.0
  • Remove the logger argument from HandleAsync

Acknowledgements

Inspired by Steven van Deursen blog posts:

commandquery's People

Contributors

hlaueriksson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

commandquery's Issues

Command functionality

Hi, I have got acquainted with your source code and it is excellent and easy to use library. But for now, there is no opportunity to return result from command. Is it in plat to implement this functionality or no?

Register ICommandProcessor in .net core DI

I am having an issue to register ICommandProcessor in WorkerProcess .net core DI

stack trace:
System.AggregateException: Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: CommandQuery.ICommandProcessor Lifetime: Transient ImplementationType: CommandQuery.CommandProcessor': Unable to resolve service for type 'CommandQuery.ICommandTypeCollection' while attempting to activate 'CommandQuery.CommandProcessor'.)
---> System.InvalidOperationException: Error while validating the service descriptor 'ServiceType: CommandQuery.ICommandProcessor Lifetime: Transient ImplementationType: CommandQuery.CommandProcessor': Unable to resolve service for type 'CommandQuery.ICommandTypeCollection' while attempting to activate 'CommandQuery.CommandProcessor'.
---> System.InvalidOperationException: Unable to resolve service for type 'CommandQuery.ICommandTypeCollection' while attempting to activate 'CommandQuery.CommandProcessor'.
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateArgumentCallSites(Type serviceType, Type implementationType, CallSiteChain callSiteChain, ParameterInfo[] parameters, Boolean throwIfCallSiteNotFound)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache lifetime, Type serviceType, Type implementationType, CallSiteChain callSiteChain)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor descriptor, Type serviceType, CallSiteChain callSiteChain, Int32 slot)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceDescriptor serviceDescriptor, CallSiteChain callSiteChain)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.ValidateService(ServiceDescriptor descriptor)
--- End of inner exception stack trace ---
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.ValidateService(ServiceDescriptor descriptor)
at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable1 serviceDescriptors, ServiceProviderOptions options) --- End of inner exception stack trace --- at Microsoft.Extensions.DependencyInjection.ServiceProvider..ctor(IEnumerable1 serviceDescriptors, ServiceProviderOptions options)
at Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(IServiceCollection services, ServiceProviderOptions options)
at Microsoft.Extensions.DependencyInjection.DefaultServiceProviderFactory.CreateServiceProvider(IServiceCollection containerBuilder)
at Microsoft.Extensions.Hosting.Internal.ServiceFactoryAdapter`1.CreateServiceProvider(Object containerBuilder)
at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at WorkerWithCommandProcessor.Program.Main(String[] args) in C:\Users\atran1\source\repos\WorkerWithCommandProcessor\WorkerWithCommandProcessor\Program.cs:line 15

How to reproduce:
fetch repo https://github.com/TNMephaGroup/WorkerWithCommandProcessor
run the solution

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.