Refactor ResultView logic under OutResults namespace
Moved ReadResultViewQuery and its handler from ResultViews to OutResults namespace. Merged ResultView mapping profile into OutResults.MappingProfiles and removed the old MappingProfile class. Updated controller references accordingly for improved organization.
This commit is contained in:
@@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using ReC.API.Extensions;
|
||||
using ReC.API.Models;
|
||||
using ReC.Application.OutResults.Commands;
|
||||
using ReC.Application.ResultViews.Queries;
|
||||
using ReC.Application.OutResults.Queries;
|
||||
|
||||
namespace ReC.API.Controllers;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using ReC.Application.OutResults.Commands;
|
||||
using ReC.Domain.Entities;
|
||||
using ReC.Domain.Views;
|
||||
|
||||
namespace ReC.Application.OutResults;
|
||||
|
||||
@@ -12,5 +13,8 @@ public class MappingProfiles : AutoMapper.Profile
|
||||
CreateMap<CreateOutResCommand, OutRes>()
|
||||
.ForMember(e => e.AddedWhen, exp => exp.MapFrom(cmd => DateTime.UtcNow))
|
||||
.ForMember(e => e.AddedWho, exp => exp.MapFrom(cmd => "ReC.API"));
|
||||
|
||||
CreateMap<CreateResultViewCommand, ResultView>()
|
||||
.ForMember(e => e.AddedWhen, exp => exp.MapFrom(cmd => DateTime.UtcNow));
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ using ReC.Application.Common.Dto;
|
||||
using ReC.Domain.Views;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace ReC.Application.ResultViews.Queries;
|
||||
namespace ReC.Application.OutResults.Queries;
|
||||
|
||||
public record ReadResultViewQuery : IRequest<IEnumerable<ResultViewDto>>
|
||||
{
|
||||
@@ -1,13 +0,0 @@
|
||||
using ReC.Application.OutResults.Commands;
|
||||
using ReC.Domain.Views;
|
||||
|
||||
namespace ReC.Application.ResultViews;
|
||||
|
||||
public class MappingProfile : AutoMapper.Profile
|
||||
{
|
||||
public MappingProfile()
|
||||
{
|
||||
CreateMap<CreateResultViewCommand, ResultView>()
|
||||
.ForMember(e => e.AddedWhen, exp => exp.MapFrom(cmd => DateTime.UtcNow));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user