From 453b6d18131c342425c1df023d9c3f7ee750509e Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 14 Jan 2026 16:23:00 +0100 Subject: [PATCH] Add ProfileController with MediatR GET endpoint Introduced ProfileController to the API, implementing a GET endpoint that uses MediatR to handle ReadProfileViewQuery requests and return profile data. This supports CQRS and structured profile retrieval. --- src/ReC.API/Controllers/ProfileController.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/ReC.API/Controllers/ProfileController.cs diff --git a/src/ReC.API/Controllers/ProfileController.cs b/src/ReC.API/Controllers/ProfileController.cs new file mode 100644 index 0000000..125dfb9 --- /dev/null +++ b/src/ReC.API/Controllers/ProfileController.cs @@ -0,0 +1,16 @@ +using MediatR; +using Microsoft.AspNetCore.Mvc; +using ReC.Application.Profile.Queries; + +namespace ReC.API.Controllers; + +[Route("api/[controller]")] +[ApiController] +public class ProfileController(IMediator mediator) : ControllerBase +{ + [HttpGet] + public async Task GetProfile([FromQuery] ReadProfileViewQuery query, CancellationToken cancel) + { + return Ok(await mediator.Send(query, cancel)); + } +} \ No newline at end of file