Create or modify Minimal API endpoints following the project's HATEOAS REST patterns with pagination, search, and sorting.
RouteGroupBuilder extension methods.Program.cs under the /api route group.RestReactAspire.Server/Endpoints/ (e.g., PatientEndpoints.cs).public static class {Entity}Endpoints
{
public static RouteGroupBuilder Map{Entity}Endpoints(this RouteGroupBuilder group)
{
group.MapGet("/", GetAll);
group.MapGet("/{id:guid}", GetById).WithName("Get{Entity}ById");
group.MapPost("/", Create);
group.MapPut("/{id:guid}", Update);
group.MapDelete("/{id:guid}", Delete);
return group;
}
}
Register in Program.cs:
api.MapGroup("{route}").Map{Entity}Endpoints();
IReadOnlyList<Link> with navigational links.self, update, delete, collection, and related resource links.PaginationLinks.Build(...).page, pageSize, search, sortBy, sortDirection.{Entity}ListResponse containing Items, Pagination, Sort, and Links.ILogger<T>.Results.NotFound() for missing resources.ActivityStatusCode.Error and log warnings on failures.RootEndpoints.cs exposes GET /api returning all discoverable link relations.