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:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -6,7 +6,7 @@ public class DtoMappingProfile : AutoMapper.Profile
|
||||
{
|
||||
public DtoMappingProfile()
|
||||
{
|
||||
CreateMap<RecActionView, RecActionDto>();
|
||||
CreateMap<RecActionView, RecActionViewDto>();
|
||||
CreateMap<OutRes, OutResDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user