CommandQuery
Command Query Separation for 🌐ASP.NET Core ⚡AWS Lambda ⚡Azure Functions ⚡Google Cloud Functions
Install / Use
/learn @hlaueriksson/CommandQueryREADME
CommandQuery<!-- omit in toc -->
Content<!-- omit in toc -->
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.
— <cite>Martin Fowler</cite>
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 ⚙️
Command Query Separation for .NET
- 📃 README: CommandQuery.md
- 💁 Samples:
CommandQuery.AspNetCore 🌐
Command Query Separation for ASP.NET Core
- 📃 README: CommandQuery.AspNetCore.md
- 💁 Samples:
CommandQuery.AWSLambda ⚡
Command Query Separation for AWS Lambda
- 📃 README: CommandQuery.AWSLambda.md
- 💁 Samples:
CommandQuery.AzureFunctions ⚡
Command Query Separation for Azure Functions
- 📃 README: CommandQuery.AzureFunctions.md
- 💁 Samples:
CommandQuery.GoogleCloudFunctions ⚡
Command Query Separation for Google Cloud Functions
- 📃 README: CommandQuery.GoogleCloudFunctions.md
- 💁 Samples:
CommandQuery.Client 🧰
Clients for CommandQuery APIs
- 📃 README: CommandQuery.Client.md
- 💁 Samples:
Upgrading
⬆️ Upgrading from version
3.0.0to4.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
loggerargument fromHandleAsync - Consider to use the
HttpRequestversions ofHandleAsync
Upgrade GoogleCloudFunctions:
- Upgrade the project target framework to
net8.0 - Remove the
loggerargument fromHandleAsync
Acknowledgements
Inspired by Steven van Deursen blog posts:
Related Skills
node-connect
341.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.6kCommit, push, and open a PR
