Refactor TestEmailTemplateController and update namespaces

- Updated `using` directives to include new namespaces.
- Marked `TestEmailTemplateController` as obsolete with a suggestion to use MediatR.
- Simplified the constructor by removing an empty block.
- Modified `GetAll` method to include `[HttpGet]` and `[Obsolete]` attributes while retaining functionality.
- Added a non-action `GetAll` method that overrides the base implementation.
This commit is contained in:
tekh 2025-06-27 13:11:40 +02:00
parent 3304b01d7b
commit 9d45082bfc
2 changed files with 32 additions and 31 deletions

View File

@ -1,12 +1,13 @@
using DigitalData.Core.DTO;
using DigitalData.Core.Abstraction.Application.DTO;
using EnvelopeGenerator.Application.Contracts.Services;
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
using Microsoft.AspNetCore.Mvc;
using static EnvelopeGenerator.CommonServices.Constants;
using static EnvelopeGenerator.Domain.Constants;
namespace EnvelopeGenerator.Web.Controllers.Test
{
namespace EnvelopeGenerator.Web.Controllers.Test;
[Obsolete("Use MediatR")]
public class TestEmailTemplateController : TestControllerBase<IEmailTemplateService, EmailTemplateDto, EmailTemplate, int>
{
public TestEmailTemplateController(ILogger<TestEmailTemplateController> logger, IEmailTemplateService service) : base(logger, service)
@ -14,6 +15,7 @@ namespace EnvelopeGenerator.Web.Controllers.Test
}
[HttpGet]
[Obsolete("Use MediatR")]
public virtual async Task<IActionResult> GetAll([FromQuery] string? tempType = null)
{
return tempType is null
@ -30,4 +32,3 @@ namespace EnvelopeGenerator.Web.Controllers.Test
[NonAction]
public override Task<IActionResult> GetAll() => base.GetAll();
}
}

View File

@ -2,8 +2,9 @@
using EnvelopeGenerator.Application.DTOs;
using EnvelopeGenerator.Domain.Entities;
namespace EnvelopeGenerator.Web.Controllers.Test
{
namespace EnvelopeGenerator.Web.Controllers.Test;
[Obsolete("Use MediatR")]
public class TestEnvelopeCertificateController : TestControllerBase<IEnvelopeCertificateService, EnvelopeCertificateDto, EnvelopeCertificate, int>
{
public TestEnvelopeCertificateController(ILogger<TestEnvelopeCertificateController> logger, IEnvelopeCertificateService service) : base(logger, service)
@ -11,4 +12,3 @@ namespace EnvelopeGenerator.Web.Controllers.Test
}
}
}