namespace DocuMed.Api.Controllers; public class PatientController : ICarterModule { public void AddRoutes(IEndpointRouteBuilder app) { var group = app.NewVersionedApi("Patient") .MapGroup($"api/patient"); group.MapGet("", GetAllAsync) .WithDisplayName("Get All Patient") .HasApiVersion(1.0); } private async Task GetAllAsync([FromQuery]int page , [FromQuery]int? count , [FromQuery]string searchName , [FromServices]IMediator mediator, CancellationToken cancellationToken) => TypedResults.Ok(await mediator.Send(new GetPatientsQuery(page, Count: count ?? Refers.SizeM, searchName), cancellationToken)); }