![]() |
VOOZH | about |
dotnet add package Lewee.Application --version 0.23.0
NuGet\Install-Package Lewee.Application -Version 0.23.0
<PackageReference Include="Lewee.Application" Version="0.23.0" />
<PackageVersion Include="Lewee.Application" Version="0.23.0" />Directory.Packages.props
<PackageReference Include="Lewee.Application" />Project file
paket add Lewee.Application --version 0.23.0
#r "nuget: Lewee.Application, 0.23.0"
#:package Lewee.Application@0.23.0
#addin nuget:?package=Lewee.Application&version=0.23.0Install as a Cake Addin
#tool nuget:?package=Lewee.Application&version=0.23.0Install as a Cake Tool
This package assists with building the application layer of an application using domain-driven design principles.
To use this packages add the following lines to your service configuration of your application (services in the code below is Microsoft.Extensions.DependencyInjection.ServicesCollection).
services.AddApplication(typeof(ApplicationLayerClass).Assembly, typeof(DomainLayerClass).Assembly);
services.AddPipelineBehaviors();
The assembly parameters of AddApplication are used to configure Mediatr (it will scan these assemblies for request and notification classes/handlers). In addition to this, the application layer assembly will by used to configure FluentValidation (it will use this assembly to scan for validators).
AddPipelineBehaviors adds the Mediatr request pipelines behaviors listed in the Pipeline Behaviors section. This only needs to be added once per application/solution; not for once each project that uses this package.
Additional behaviors can be added as parameters to AddPipelineBehaviors.
Mediatr is used to assist with mediation, which allows the presentation layer of the application to have less dependencies e.g. API controller classes only need to inject the IMediator interface to handle web requests.
There a several interfaces that add a further layer of command-query responsibility separation (CQRS) on top of the IRequest interface in Mediatr.
Both IQuery and ICommand implement , which has a CorrelationId Guid property.
As mentioned in the Pipeline Behaviors section, the CorrelationId property is used in the CorelationIdLoggingBehavior to decorate the logs with the correlation ID for every Mediatr request that implements IApplicationRequest.
Query handlers that handle IQuery input types are required to have as the return type. QueryResult has a type parameter that is used to specify the query data type.
Command handlers that handle ICommand input types are required to return a .
Both QueryResult and CommandResult inherit from , which has the following properties.
IsSuccess
Status
Errors
ITenantedRequest has a TenantId Guid property used to specify the tenant ID for multi-tenanted applications.
As mentioned in the Pipeline Behaviors section, the TenantId property is used in the TenantLoggingBehavior to decorate the logs with tenant ID for every Mediatr request that implements ITenantedRequest.
CorrelationId structured logging property for every request. Uses CorrelationId property if the request implemenats IApplicationRequest, otherwise it generates a new GUID.Status of requests that have Result return types and logs an error if there was an unexpected failure, or an information log if there was domain/validation failure.Serilog's BeginTimedOperation functionality to log the time taken to execute the request.TenantId structured logging property for every request that implements ITenantedRequest.FluentValidation validators for the request and returns a CommandResult with the errors dictionary populated if there are validation errors found, otherwise the rest of the pipeline is executed.The can be published via Mediatr.IMediator.Publish to send a SignalR event to the a client application.
.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on Lewee.Application:
| Package | Downloads |
|---|---|
|
Lewee.Infrastructure.AspNet
Package Description |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.23.0 | 332 | 6/14/2024 |
| 0.22.0 | 272 | 6/3/2024 |
| 0.21.0 | 358 | 9/24/2023 |
| 0.20.0-alpha.1 | 109 | 9/24/2023 |
| 0.17.0-alpha.1 | 156 | 9/23/2023 |
| 0.16.0-alpha.1 | 159 | 9/23/2023 |
| 0.10.0 | 304 | 9/19/2023 |
| 0.9.0 | 267 | 9/17/2023 |
| 0.8.0 | 303 | 9/3/2023 |
| 0.7.0 | 306 | 9/3/2023 |
| 0.6.0 | 276 | 9/1/2023 |
| 0.5.3 | 317 | 8/25/2023 |
| 0.1.0 | 419 | 3/28/2023 |