pvNugsLoggerNc9ResWrapper 9.1.1
dotnet add package pvNugsLoggerNc9ResWrapper --version 9.1.1
NuGet\Install-Package pvNugsLoggerNc9ResWrapper -Version 9.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="pvNugsLoggerNc9ResWrapper" Version="9.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="pvNugsLoggerNc9ResWrapper" Version="9.1.1" />
<PackageReference Include="pvNugsLoggerNc9ResWrapper" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add pvNugsLoggerNc9ResWrapper --version 9.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: pvNugsLoggerNc9ResWrapper, 9.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package pvNugsLoggerNc9ResWrapper@9.1.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=pvNugsLoggerNc9ResWrapper&version=9.1.1
#tool nuget:?package=pvNugsLoggerNc9ResWrapper&version=9.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
pvNugsLoggerNc9ResWrapper
A .NET 9.0 library providing robust result wrapper classes for HTTP operations and method executions. This package helps standardize the way method results and HTTP responses are handled, with built-in support for notifications, severity levels, and mutation tracking.
Features
- HTTP Result Wrapping: Standardized wrapper for HTTP responses with
DsoHttpResult
andDsoHttpResult<T>
- Method Result Handling: Comprehensive result wrapper with
MethodResult
andMethodResult<T>
- Severity-based Status: Automatic HTTP status code mapping based on severity levels
- Mutation Tracking: Built-in support for tracking Create, Update, Delete operations
- Rich Notification System: Support for multiple notifications with severity levels
- Exception Integration: Seamless conversion of exceptions to result objects
- Pagination Support: Built-in handling for paginated results
- Strongly Typed: Generic support for typed result data
Installation
shell
dotnet add package pvNugsLoggerNc9ResWrapper
Usage
Basic HTTP Result
csharp
// Create a successful result
var result = new DsoHttpResult();
// Create a result with specific severity
var errorResult = new DsoHttpResult(SeverityEnu.Error);
// Add notifications
result.AddNotification("Operation completed", SeverityEnu.Info);
Typed HTTP Result
csharp
// Return data with success status
var result = new DsoHttpResult<User>(user);
// Return data with pagination
var pagedResult = new DsoHttpResult<List<User>>(users, hasMoreResults: true);
// Return data with mutation tracking
var createResult = new DsoHttpResult<User>(newUser, DsoHttpResultMutationEnu.Create);
Method Result
csharp
// Create a successful result
var result = MethodResult.Ok;
// Create a result with error
var errorResult = new MethodResult("Operation failed", SeverityEnu.Error);
// Handle exceptions
try
{
// Some operation
}
catch (Exception ex)
{
return new MethodResult(ex);
}
Typed Method Result
csharp
// Return data
var result = new MethodResult<User>(user);
// Return null data
var nullResult = MethodResult<User>.Null;
// Multiple notifications
var result = new MethodResult<User>(
new[] { "Warning 1", "Warning 2" },
SeverityEnu.Warning
);
Dependencies
- .NET 9.0
- pvNugsLoggerNc9Abstractions (>= 9.0.0)
- pvNugsEnumConvNc9 (>= 9.0.0)
License
This project is licensed under the terms of the license provided by Pierre Van Wallendael.
Author
Pierre Van Wallendael
Repository
Version History
9.0.0
- Initial release
- Full .NET 9.0 support
- Complete result wrapper implementation
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- pvNugsEnumConvNc9 (>= 9.0.1)
- pvNugsLoggerNc9Abstractions (>= 9.1.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Aligned with abstraction version 9.1.3