All notable changes to SharpDispatch are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
CommandDispatchResultenhancements (backwards compatible):IsSuccess/IsFailureconvenience properties.FromException(Exception)factory for converting caught exceptions into a failed result.
AddCommandHandler<TCommand, THandler>(ServiceLifetime)— new overload that registers handlers with an explicit lifetime (previously always singleton).InMemoryCommandDispatcherconveniences:- Delegate registration overloads:
RegisterHandler<TCommand>(Func<TCommand, CancellationToken, Task<CommandDispatchResult>>)andRegisterHandler<TCommand>(Func<TCommand, Task<CommandDispatchResult>>). HandlerCountproperty andContainsHandler<TCommand>()method.
- Delegate registration overloads:
TryDecorate<TService, TDecorator>()DI extension — wraps the current service registration with a decorator (no-op when unregistered, preserves the original lifetime). Makes the documented decorator/logging pattern first-class.- Test suite (
tests/SharpDispatch.Tests, xUnit, 43 tests) covering all dispatchers, lifetimes, registration helpers, decoration and results. - Runnable examples:
examples/ConsoleQuickStart— minimal end-to-end usage.examples/MinimalApi— ASP.NET Core minimal API with a logging decorator.examples/HighPerformance— optimized dispatcher with struct commands.
- Structured documentation under
docs/(getting started, dispatcher guide, advanced patterns, Native AOT guide, API reference) and this changelog.
- Package references updated to the latest stable versions:
Microsoft.Extensions.DependencyInjection.Abstractions10.0.9 → 10.0.11Microsoft.SourceLink.GitHub10.0.300 → 10.0.400
- CI workflow now builds the whole solution and runs the test suite.
- README / NuGet README: corrected the decorator example (now uses
TryDecorate), clarified scoped-handler semantics, added links to docs and examples.
- README "Chained Dispatchers" example referenced a non-existent
services.Decorate<T, T>()API; the pattern now usesTryDecorate. - Misleading "zero-copy
ReadOnlySpan<T>in commands" claim removed (spans are ref structs and cannot be stored on commands).
- SourceLink integration (
Microsoft.SourceLink.GitHub), embedded sources and deterministic build settings for step-into debugging on NuGet.org. - Package metadata, release notes and documentation refresh.
- Initial release of SharpDispatch:
ICommand,ICommandHandler<TCommand>,ICommandDispatcher,CommandDispatchResult.ServiceProviderCommandDispatcher,OptimizedCommandDispatcher,InMemoryCommandDispatcherand the reflection-freeCommandDispatcherBuilder.DispatchServiceCollectionExtensions(AddCommandHandler,AddCommandDispatcher,AddOptimizedCommandDispatcher).- Target: .NET 10 (C# 14), Native AOT-ready.