Files
EnvelopeGenerator/EnvelopeGenerator.Web/Controllers/Test/TestEmailTemplateController.cs
TekH ec674b6e80 Refactor TestEmailTemplateController to use MediatR
Replaced direct service dependency and base class inheritance with MediatR in TestEmailTemplateController. Updated the GetAll endpoint to use a MediatR query and removed obsolete code related to the previous service-based approach. This aligns the controller with CQRS/MediatR best practices.
2026-02-11 12:45:32 +01:00

22 lines
593 B
C#

using Microsoft.AspNetCore.Mvc;
using MediatR;
using EnvelopeGenerator.Application.EmailTemplates.Queries;
namespace EnvelopeGenerator.Web.Controllers.Test;
public class TestEmailTemplateController : ControllerBase
{
private readonly IMediator _mediator;
public TestEmailTemplateController(IMediator mediator)
{
_mediator = mediator;
}
[HttpGet]
public virtual async Task<IActionResult> GetAll([FromQuery] ReadEmailTemplateQuery query, CancellationToken cancel)
{
var res = await _mediator.Send(query, cancel);
return Ok(res);
}
}