Abstractions
Namespace: RA.Utilities.Api.Abstractions
The interfaces within the RA.Utilities.Api.Abstractions namespace define the core contracts for the package's compile-time endpoint registration pattern.
✨ Purpose and Function
These interfaces keep each endpoint in its own feature-focused file while organizing endpoints into shared route groups — the foundation of a clean Vertical Slice Architecture for Minimal APIs. Both are static-abstract contracts discovered by the source generator at compile time, so no reflection or DI scanning is involved.
The primary abstractions are:
IEndpoint: Implemented per endpoint. Declares theGroupNameof the group it belongs to and theMapEndpointmethod that maps its routes onto the group'sRouteGroupBuilder.IEndpointGroup: Implemented per feature. Declares a uniqueGroupNameand theMapGroupmethod that receives the application'sIEndpointRouteBuilderand returns the configuredRouteGroupBuilderevery endpoint in the group inherits.
🧠 Summary
In summary, the RA.Utilities.Api.Abstractions interfaces are the cornerstone of the endpoint mapping pattern. See HttpEndpointServiceCollectionExtensions for how app.MapEndpoints() wires them together at compile time.
IEndpoint
The primary purpose of the IEndpoint interface is to organize and declutter API endpoint registration in an ASP.NET Core application.
IEndpointGroup
The IEndpointGroup interface represents a shared route group that IEndpoint implementations map their routes into.