Introduction
RA.Utilities provides a set of reusable, opinionated building blocks primarily aimed at solving common problems in web API development. The high-level purpose is to reduce boilerplate code, enforce consistency, promote a clean architecture (specifically Vertical Slice Architecture using the CQRS pattern), and improve the overall developer experience.
Start with RA.Utilities.Core.Results
The Result monad, exception hierarchy, and HTTP constants are the foundation every other package builds on. Master these in 5 minutes — then everything else clicks into place.
Get StartedNo sign-up. No dependency chain. Just install the package and go.
🚀 Getting Started
New to RA.Utilities? Here is the recommended reading order — each layer builds on the one before it.
| Step | Layer | Start here | What you will learn |
|---|---|---|---|
| 1. Foundation | Core | Core Overview | The Result monad, exception hierarchy, and HTTP constants — these underpin everything else |
| 2. Business Logic | Application | Feature Mediator | CQRS handlers, the custom mediator, and pipeline behaviors |
| 3. API Layer | Api | Api Package | Endpoint registration, exception handling, validation filters, and standardized responses |
Each package is opt-in — adopt only the layers your project needs.
Quick Install
# Start with the foundation
dotnet add package RA.Utilities.Core.Results
dotnet add package RA.Utilities.Core.Exceptions
# Add the mediator and CQRS support
dotnet add package RA.Utilities.Feature
# Wire up your API
dotnet add package RA.Utilities.Api
🔑 Key Benefits
RA.Utilities is a suite of NuGet packages designed to accelerate and standardize .NET web API development. Each package encapsulates best practices and reusable components that help developers build robust, maintainable, and scalable applications with minimal boilerplate.
- 🧱 Modular Architecture: Plug-and-play components for logging, authentication, error handling, and more.
- 📦 NuGet-Ready: Easily integrate into your projects via NuGet for fast setup and consistent behavior.
- 🧭 Clean Design Patterns: Built around CQRS and vertical slice architecture to promote separation of concerns and testability.
- 📈 Developer Productivity: Reduce repetitive code and focus on business logic.
- 📚 Built-in Documentation: Seamless OpenAPI integration for clear and interactive API docs.
Whether you are starting a new project or refactoring an existing one, RA.Utilities helps you build better APIs — faster.
🗺️ Solution Structure
The tree below shows how every RA.Utilities package depends on the others.
Each node's children are the packages it depends on — every branch points inward, toward the Core layer, per the Dependency Rule. Solid edges are runtime package references; dashed edges are compile-time analyzers shipped inside the package (RA.Utilities.Api.Generators inside RA.Utilities.Api, RA.Utilities.Feature.Generators inside RA.Utilities.Feature, RA.Utilities.Integrations.Generators inside RA.Utilities.Integrations). RA.Utilities.Authentication.JwtBearer, RA.Utilities.Authorization, RA.Utilities.Logging.Core, and RA.Utilities.Core.Results are standalone packages with no RA.Utilities dependencies.
| Layer/Concern | RA.Utilities Package(s) | Purpose |
|---|---|---|
| API & Web | RA.Utilities.Api, RA.Utilities.Api.Response, RA.Utilities.Api.Middlewares, RA.Utilities.OpenApi, RA.Utilities.Authentication.JwtBearer, RA.Utilities.Authorization | Provides helpers for standardized API responses (SuccessResponse), middleware for logging and header validation, automates OpenAPI/Swagger documentation, and simplifies access to authenticated user data. |
| Application Logic | RA.Utilities.Feature | This is the heart of the CQRS implementation. It provides base classes for your feature "handlers" and a validation pipeline to automatically validate incoming requests. |
| Core Building Blocks | RA.Utilities.Core.Constants, RA.Utilities.Core.Exceptions | Offers shared constants (like HTTP status codes) and a set of standardized exceptions (NotFoundException, ConflictException) to create clear, semantic error handling. |
| Data Access | RA.Utilities.Data.Abstractions, RA.Utilities.Data.EntityFramework | Provides abstractions and implementations for talking to the database. |
| Integrations | RA.Utilities.Integrations | Simplifies and standardizes HTTP client calls to external APIs, with built-in support for configuration, logging, and resilience policies. |
| Logging | RA.Utilities.Logging.Core, RA.Utilities.Logging.Shared | Provides a one-line setup for production-ready structured logging with Serilog. |
📦 Package Index
This table provides a quick overview of all packages available in the RA.Utilities ecosystem, along with their current versions and download statistics from NuGet.
📚 Browse by Category
Introduction
Packages
Core
4 items
Api
3 items
Authorization / Authentication
2 items
Application
3 items
Data
3 items
RA.Utilities.Integrations
10 items
Logging
2 items
Archived
1 item