22 lines
672 B
C#
22 lines
672 B
C#
#nullable enable
|
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Svrnty.CQRS.Configuration;
|
|
|
|
namespace Svrnty.CQRS.MinimalApi;
|
|
|
|
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;
|
|
}
|
|
}
|