Refactor: replace RecActionDto with RecActionViewDto

Standardize usage of RecActionViewDto across the codebase:
- Update pipeline behaviors, mapping profiles, and commands to use RecActionViewDto.
- Remove RecActionDto and introduce RecActionViewDto with equivalent properties and methods.
- Adjust query handlers and related interfaces to work with RecActionViewDto.
This clarifies DTO usage and aligns the model with domain intent.
This commit is contained in:
2025-12-12 15:04:43 +01:00
parent f53603083a
commit 71a0220c3f
6 changed files with 10 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore;
namespace ReC.Application.Common.Behaviors;
public class BodyQueryBehavior<TRequest, TResponse>(IRecDbContext dbContext) : IPipelineBehavior<TRequest, TResponse>
where TRequest : RecActionDto
where TRequest : RecActionViewDto
where TResponse : notnull
{
public async Task<TResponse> Handle(TRequest action, RequestHandlerDelegate<TResponse> next, CancellationToken cancel)

View File

@@ -8,7 +8,7 @@ using System.Text.Json;
namespace ReC.Application.Common.Behaviors;
public class HeaderQueryBehavior<TRequest, TResponse>(IRecDbContext dbContext, ILogger<HeaderQueryBehavior<TRequest, TResponse>>? logger = null) : IPipelineBehavior<TRequest, TResponse>
where TRequest : RecActionDto
where TRequest : RecActionViewDto
where TResponse : notnull
{
public async Task<TResponse> Handle(TRequest action, RequestHandlerDelegate<TResponse> next, CancellationToken cancel)

View File

@@ -6,7 +6,7 @@ public class DtoMappingProfile : AutoMapper.Profile
{
public DtoMappingProfile()
{
CreateMap<RecActionView, RecActionDto>();
CreateMap<RecActionView, RecActionViewDto>();
CreateMap<OutRes, OutResDto>();
}
}

View File

@@ -3,7 +3,7 @@ using ReC.Domain.Constants;
namespace ReC.Application.Common.Dto;
public record RecActionDto
public record RecActionViewDto
{
public required long Id { get; init; }