Grondo — Comprehensive Usage Guide
A complete reference for every public API in the Grondo library with practical code examples.
Requirements: .NET 10 · C# 14 · ASP.NET Core
Getting Started
Installation
dotnet add package Grondo
Using Directives
using Grondo; // Result<T>, Result<T,TError>, Result, Maybe<T>, Either<L,R>, Validation<T>, OneOf<T1..T4>, Error, Combinators
using Grondo.Extensions; // All extension methods (including ToProblemDetails on ExceptionBase)
using Grondo.Exceptions; // ExceptionBase, ErrorResponse, exception-handling middleware, and all domain exceptions
using Grondo.Utilities; // Environments, StringFactory, JsonDefaults
ASP.NET Core Shared Framework
Grondo uses a <FrameworkReference> to the ASP.NET Core shared framework (Microsoft.AspNetCore.App), which is installed with the .NET SDK. This is not an external NuGet package dependency.
The library provides extension methods for:
IServiceProvider(ServiceProviderEx) — Scoped service resolution (sync and async)IHostEnvironment(EnvironmentEx) — Environment name checks (IsLocal, IsTest, IsUat, IsProduction, IsDevelopment, IsStaging)IConfiguration(ConfigurationEx) — Typed configuration value retrieval with GetValue, GetRequiredValue , GetSection HttpRequest(HttpEx) — Raw body extraction, query params, form data, client IP, AJAX detection
This makes Grondo primarily suitable for ASP.NET Core applications (web APIs, MVC, Blazor). Most extension methods (strings, collections, dates, Result
What’s Inside
Extension Methods
32 extension method classes covering strings, collections, dates, JSON, HTTP, tasks, guards, async LINQ, memoization, and more.
Custom Exceptions
14 HTTP-aware domain exceptions with status codes and message headers, including ValidationException with field-level errors.
Utilities
Environment name constants and unique string generation.
Types
Result<T>, Result<T, TError>, Result, Maybe<T>, Either<L,R>, Validation<T>, and OneOf<T1..T4> — comprehensive functional programming types with LINQ query syntax support.