HandleR 1.0.2
See the version list below for details.
dotnet add package HandleR --version 1.0.2
NuGet\Install-Package HandleR -Version 1.0.2
<PackageReference Include="HandleR" Version="1.0.2" />
paket add HandleR --version 1.0.2
#r "nuget: HandleR, 1.0.2"
// Install HandleR as a Cake Addin #addin nuget:?package=HandleR&version=1.0.2 // Install HandleR as a Cake Tool #tool nuget:?package=HandleR&version=1.0.2
HandleR
Summary
The focus of this library is to allow the decoupling of multiple dependancies when writting a service in code.
The pattern this library promotes is one of single responsibility for each IHandler/IHandlerAsync to each request (IRequest of type T) and tightly couples their relationship.
This pattern also makes unit testing legacy classes full of bloated constructor arguements a thing of the past, by creating smaller units of work IHandler/IHandlerAsync you focus less on mocking objects and more on on the functional code you want to prove works.
Usage
- To use HandleR simply:
- Create your implementations of
- IRequest - a generic interface where you declare the return type for the instance of this request.
- IHandler/IHandlerAsync - generic interfaces which couple to your concrete type of IRequest ensuring that you set the value of the member ForRequest to the typeof(your concret request class).
- Use either the direct registration technique using the function RegisterHandler on the concrete class HandlerProvider or with your own IOC framework inject all your registered instances of IHandler/IHandlerAsync into the factory constrcutor which accepts a IEnumerable source which will return you an instance of IHandlerProvider.
- Manually declare the instance or with use of an IOC framework register the IHandlerProvider to the instance of HandlerProvider and Inject the IHandlerProvider instance into your code where you see fit.
- To trigger your handlers call HandleRequest/HandleRequestAsync on the instance of IHandlerProvider depending on whether your registered your handler as IHandler/IHandlerAsync.
- Create your implementations of
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net5.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.