Skip to main content

RA.Utilities.Api

NuGet version Codecov GitHub license NuGet Downloads

RA.Utilities.Api provides a collection of essential utilities for building robust and consistent ASP.NET Core APIs. This package includes endpoint registration helpers, standardized response models, and exception handling middleware to streamline development and promote best practices.

It acts as the glue between the RA.Utilities.Core libraries and your web application, providing concrete implementations for ASP.NET Core.

🎯 Purpose

This package is designed to solve two common challenges in API development:

  1. Consistent Error Handling: It provides a middleware that automatically catches custom exceptions from RA.Utilities.Core.Exceptions (like NotFoundException, ConflictException) and transforms them into standardized JSON responses using models from RA.Utilities.Api.Results.
  2. Clean Endpoint Organization: It offers a simple pattern for organizing API endpoints into separate files, keeping your Program.cs clean and your routes maintainable as the application grows.

By using this package, you can significantly reduce boilerplate code and enforce consistency across all your API endpoints.

🛠️ Installation

You can install the package via the .NET CLI:

dotnet add package RA.Utilities.Api

Or through the NuGet Package Manager console:

Install-Package RA.Utilities.Api

Or through the NuGet Package Manager in Visual Studio.

🔗 Dependencies