From fb12cb6c98c4fe70e3d486b16fb2628ab7c8d2a1 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 12 Jan 2026 11:32:39 +0100 Subject: [PATCH] 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. --- src/ReC.API/Controllers/ResultViewController.cs | 2 +- src/ReC.Application/OutResults/MappingProfiles.cs | 4 ++++ .../Queries/ReadResultViewQuery.cs | 2 +- src/ReC.Application/ResultViews/MappingProfile.cs | 13 ------------- 4 files changed, 6 insertions(+), 15 deletions(-) rename src/ReC.Application/{ResultViews => OutResults}/Queries/ReadResultViewQuery.cs (97%) delete mode 100644 src/ReC.Application/ResultViews/MappingProfile.cs diff --git a/src/ReC.API/Controllers/ResultViewController.cs b/src/ReC.API/Controllers/ResultViewController.cs index f593379..38bbfb8 100644 --- a/src/ReC.API/Controllers/ResultViewController.cs +++ b/src/ReC.API/Controllers/ResultViewController.cs @@ -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; diff --git a/src/ReC.Application/OutResults/MappingProfiles.cs b/src/ReC.Application/OutResults/MappingProfiles.cs index e1600f0..6659fba 100644 --- a/src/ReC.Application/OutResults/MappingProfiles.cs +++ b/src/ReC.Application/OutResults/MappingProfiles.cs @@ -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() .ForMember(e => e.AddedWhen, exp => exp.MapFrom(cmd => DateTime.UtcNow)) .ForMember(e => e.AddedWho, exp => exp.MapFrom(cmd => "ReC.API")); + + CreateMap() + .ForMember(e => e.AddedWhen, exp => exp.MapFrom(cmd => DateTime.UtcNow)); } } \ No newline at end of file diff --git a/src/ReC.Application/ResultViews/Queries/ReadResultViewQuery.cs b/src/ReC.Application/OutResults/Queries/ReadResultViewQuery.cs similarity index 97% rename from src/ReC.Application/ResultViews/Queries/ReadResultViewQuery.cs rename to src/ReC.Application/OutResults/Queries/ReadResultViewQuery.cs index aea422f..e8321d1 100644 --- a/src/ReC.Application/ResultViews/Queries/ReadResultViewQuery.cs +++ b/src/ReC.Application/OutResults/Queries/ReadResultViewQuery.cs @@ -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> { diff --git a/src/ReC.Application/ResultViews/MappingProfile.cs b/src/ReC.Application/ResultViews/MappingProfile.cs deleted file mode 100644 index a440f31..0000000 --- a/src/ReC.Application/ResultViews/MappingProfile.cs +++ /dev/null @@ -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() - .ForMember(e => e.AddedWhen, exp => exp.MapFrom(cmd => DateTime.UtcNow)); - } -} \ No newline at end of file