Skip to main content

RA.Utilities.Integrations

· 2 min read
Redon Alla
.NET, React, Angular Developer

Version 10.0.0

Date Badge NuGet version

Updated package version 10.0.9-rc (release candidate) to 10.0.0, indicating a transition to a stable release. This change signifies that the project is no longer in the release candidate phase and is considered ready for production use, reflecting confidence in its stability and completeness.

Version 10.0.0-rc.2

Date Badge NuGet version

This release modernizes the RA.Utilities.Integrations package, providing a robust and repeatable pattern for managing external API integrations. It centralizes configuration, simplifies registration, and improves resilience with built-in retry policies.

✨ New Features

  • Standardized Configuration:

    • Centralizes HTTP client settings (Base URL, timeouts, headers) in appsettings.json using the HttpClientSettings base class.
  • Simplified Registration:

    • Introduced the AddIntegrationHttpClient<TClient, TSettings> extension method to register a typed HttpClient, bind its configuration, and apply default policies with a single line of code.
  • Built-in Resilience:

    • Includes a default transient error handling policy (retry with exponential backoff) using Polly, improving the reliability of external API calls.
  • Promotes Best Practices:

    • Encourages the use of typed HttpClients via IHttpClientFactory, which provides better compile-time safety, intellisense, and connection management.
  • Updated Documentation:

    • The README.md has been updated to provide a clear, step-by-step guide for setting up a typed client, from configuration to implementation.

🚀 Getting Started

Register your typed HTTP client in Program.cs:

var builder = WebApplication.CreateBuilder(args);

// Register the typed client for "MyApi" integration
builder.Services.AddIntegrationHttpClient<IMyApiClient, MyApiClient, MyApiSettings>(
builder.Configuration,
configSection: "Integrations:MyApi"
);

var app = builder.Build();