From d27c3f3fc7ac160174f2a2aa621cc4da5cbdfcb2 Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 3 Dec 2025 13:57:13 +0100 Subject: [PATCH] Update MappingProfiles with AddedWhen and AddedWho mappings Reordered `using` directives for clarity and added `ReC.Domain.Entities`. Added a `TODO` comment to indicate that `AddedWho` should be injected from the current host/user context. Updated `CreateMap` in `MappingProfiles` to set `AddedWhen` to `DateTime.UtcNow` and `AddedWho` to the hardcoded value `"ReC.API"`. --- src/ReC.Application/OutResults/MappingProfiles.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ReC.Application/OutResults/MappingProfiles.cs b/src/ReC.Application/OutResults/MappingProfiles.cs index d3e6372..26f01dc 100644 --- a/src/ReC.Application/OutResults/MappingProfiles.cs +++ b/src/ReC.Application/OutResults/MappingProfiles.cs @@ -1,13 +1,15 @@ -using AutoMapper; -using ReC.Application.OutResults.Commands; +using ReC.Application.OutResults.Commands; using ReC.Domain.Entities; namespace ReC.Application.OutResults; +// TODO: update to inject AddedWho from the current host/user contex public class MappingProfiles : AutoMapper.Profile { public MappingProfiles() { - CreateMap(); + CreateMap() + .ForMember(e => e.AddedWhen, exp => exp.MapFrom(cmd => DateTime.UtcNow)) + .ForMember(e => e.AddedWho, exp => exp.MapFrom(cmd => "ReC.API")); } } \ No newline at end of file