BlogDoFT.Libs.Api
1.12.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package BlogDoFT.Libs.Api --version 1.12.0
NuGet\Install-Package BlogDoFT.Libs.Api -Version 1.12.0
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="BlogDoFT.Libs.Api" Version="1.12.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlogDoFT.Libs.Api" Version="1.12.0" />
<PackageReference Include="BlogDoFT.Libs.Api" />
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 BlogDoFT.Libs.Api --version 1.12.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: BlogDoFT.Libs.Api, 1.12.0"
#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 BlogDoFT.Libs.Api@1.12.0
#: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=BlogDoFT.Libs.Api&version=1.12.0
#tool nuget:?package=BlogDoFT.Libs.Api&version=1.12.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
BlogDoFT.Libs.Api
Lightweight helpers and conventions for building HTTP APIs. This library contains small helpers and extension patterns used across BlogDoFT Web API projects.
This README describes common integration patterns rather than a complete API reference. See the repository for implementation details.
Common patterns
- Mapping domain
Result<T>to HTTP responses
// Example service method
public Result<UserDto> GetUser(Guid id) { ... }
// In controller action
var result = userService.GetUser(id);
if (result.IsFailure)
return result.Failure.Code switch
{
"NOT_FOUND" => Results.NotFound(new { code = result.Failure.Code, message = result.Failure.Message }),
_ => Results.BadRequest(new { code = result.Failure.Code, message = result.Failure.Message })
};
return Results.Ok(result.Value);
- Mapping
DomainNotificationBagto HTTP responses
if (notificationBag.HasNotifications)
{
var errors = notificationBag.Notifications
.Select(n => new { code = n.Code, message = n.Message });
return Results.BadRequest(new { errors });
}
- Middleware wiring suggestions
- Add a small middleware or filter that converts
Result/DomainNotificationBagto HTTP responses centrally to avoid repetitive controller code. - When returning validation-like problems, prefer 400/422 with a stable problem payload:
{ "errors": [{"code":"...","message":"..."}] }.
Examples and recommended payloads
{
"errors": [
{ "code": "INVALID_EMAIL", "message": "Email is invalid" }
]
}
Notes
- This project is intentionally small — prefer to keep API-layer concerns (presentation, HTTP mapping) decoupled from domain logic. Use
BlogDoFT.Libs.ResultPatternandBlogDoFT.Libs.DomainNotificationsto standardize domain results and notifications.
| 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
- Microsoft.AspNetCore.Http (>= 2.3.12)
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 |
|---|---|---|
| 10.1.1 | 143 | 9/24/2026 |
| 10.1.0 | 106 | 9/14/2026 |
| 10.0.1 | 103 | 9/14/2026 |
| 10.0.0 | 112 | 9/13/2026 |
| 1.14.0 | 111 | 9/13/2026 |
| 1.13.0 | 109 | 9/13/2026 |
| 1.12.0 | 124 | 8/27/2026 |
| 1.11.0 | 112 | 8/27/2026 |
| 1.10.0 | 369 | 11/16/2025 |
| 1.9.0 | 262 | 11/5/2025 |
| 1.8.0 | 263 | 11/3/2025 |
| 1.7.0 | 257 | 11/3/2025 |
| 1.6.3 | 235 | 10/21/2025 |
| 1.6.0 | 230 | 10/21/2025 |
| 1.5.0 | 244 | 10/8/2025 |