dotnet-cqrs/Svrnty.CQRS/WebApplicationExtensions.cs
Mathias Beaulieu-Duncan c6de10b98b Move UseSvrntyCqrs() from MinimalApi to core Svrnty.CQRS package
gRPC-only projects couldn't call app.UseSvrntyCqrs() without adding the
MinimalApi package. The method only calls ExecuteMappingCallbacks() which
is already in core — it had no MinimalApi dependency. Adds ASP.NET Core
FrameworkReference to the core package.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 06:38:26 -04:00

20 lines
643 B
C#

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Svrnty.CQRS.Configuration;
namespace Svrnty.CQRS;
public static class WebApplicationExtensions
{
/// <summary>
/// Maps all configured CQRS endpoints (gRPC, MinimalApi, and Dynamic Queries).
/// This method is framework-agnostic and executes mapping callbacks registered by extension packages.
/// </summary>
public static WebApplication UseSvrntyCqrs(this WebApplication app)
{
var config = app.Services.GetRequiredService<CqrsConfiguration>();
config.ExecuteMappingCallbacks(app);
return app;
}
}