OESSolution.Result.Wolverine
1.0.0
dotnet add package OESSolution.Result.Wolverine --version 1.0.0
NuGet\Install-Package OESSolution.Result.Wolverine -Version 1.0.0
<PackageReference Include="OESSolution.Result.Wolverine" Version="1.0.0" />
<PackageVersion Include="OESSolution.Result.Wolverine" Version="1.0.0" />
<PackageReference Include="OESSolution.Result.Wolverine" />
paket add OESSolution.Result.Wolverine --version 1.0.0
#r "nuget: OESSolution.Result.Wolverine, 1.0.0"
#:package OESSolution.Result.Wolverine@1.0.0
#addin nuget:?package=OESSolution.Result.Wolverine&version=1.0.0
#tool nuget:?package=OESSolution.Result.Wolverine&version=1.0.0
OESSolution.Result.Wolverine
A NuGet package that integrates the Result pattern with the Wolverine framework for .NET applications.
This package provides a clean, domain‑agnostic way to handle Result and Result<T> across HTTP endpoints and message handlers, enabling automatic error handling, validation, and response generation—without coupling your domain or application logic to Wolverine or HTTP concerns.
Key Principles
- Domain‑agnostic: No dependency on domain‑specific exceptions or inheritance.
- Result‑centric: Behavior is driven by Result and Error, not exception types.
- Framework‑level: Designed to be published once and reused across multiple applications.
- Clean Architecture friendly: Clear separation between domain, application, middleware, and transport layers.
Features
HTTP Response Handling
ResultHttpPolicy automatically processes Result<T> and Result return types from HTTP endpoints.
- Result<T>
- Success → 200 OK with JSON body
- Result
- Success → 204 No Content
- Failure
- Automatically mapped to ProblemDetails
- HTTP status codes derived from Error (e.g. Validation, NotFound, Conflict)
- No manual response mapping is required.
Message Handler Processing
ResultHandlerPolicy adds automatic short‑circuiting to message handlers.
- If a handler returns a failed Result, further processing stops
- Designed for cascading messages and workflows
- No explicit checks required in handler code
Automatic Middleware Application
AutoResultPolicies apply middleware automatically to Wolverine pipelines:
- FluentValidation integration
- Executes registered
IValidator<T> - Converts validation failures into Result failures
- Executes registered
- Exception handling
- Converts exceptions carrying Error information into Result failures
- Infrastructure and unexpected exceptions are re‑thrown
- The middleware does not depend on domain exception types—only on the presence of Error.
Configuration Extensions
Provides extension methods for simple setup:
WolverineOptionsWolverineHttpOptions
No manual pipeline wiring is required.
Installation
dotnet add package OESSolution.Result.Wolverine
Usage
Basic Setup
using OESSolution.Result.Wolverine;
builder.Services.AddWolverine(opts =>
{
opts.UseEnterpriseResultPattern();
});
builder.Services.AddWolverineHttp(opts =>
{
opts.UseEnterpriseResultPatternHttp();
});
HTTP Endpoint Example
public class MyEndpoint
{
public Result<MyData> GetData(Query query)
{
if (someCondition)
return Error.NotFound("Data.NotFound", "Data not found");
return new MyData();
}
}
Automatically produces:
- 200 OK with JSON on success
- 404 Not Found with ProblemDetails on failure
Message Handler Example
public class MyHandler
{
public Result Handle(MyMessage message)
{
return Result.Success();
}
}
If a failure is returned, processing stops automatically.
Validation Example
public class MyRequestValidator : AbstractValidator<MyRequest>
{
public MyRequestValidator()
{
RuleFor(x => x.Name).NotEmpty();
}
}
Validation failures are converted into Result failures without additional code.
Dependencies
- Wolverine
- FluentValidation
- OESSolution.Result (for Result and Error types)
Contributing
Contributions are welcome.
Please submit issues or pull requests with clear descriptions and rationale.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- FluentValidation (>= 12.1.1)
- FluentValidation.DependencyInjectionExtensions (>= 12.1.1)
- OESSolution.Result (>= 1.0.1)
- WolverineFx (>= 5.9.2)
- WolverineFx.Http (>= 5.9.2)
- WolverineFx.Http.FluentValidation (>= 5.9.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|