From 1e21d133ae6e5b7b87485d1b69507ec98437a187 Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 3 Dec 2025 12:50:38 +0100 Subject: [PATCH] Add mappings for AddedWhen and AddedWho in MappingProfile Added a TODO comment to update `AddedWho` to be injected from the current host/user context. Configured `AddedWhen` to use the current UTC time (`DateTime.UtcNow`) and set `AddedWho` to the string `"ReC.API"`. --- src/ReC.Application/Endpoints/MappingProfile.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ReC.Application/Endpoints/MappingProfile.cs b/src/ReC.Application/Endpoints/MappingProfile.cs index 4e9d02e..8bfbd0f 100644 --- a/src/ReC.Application/Endpoints/MappingProfile.cs +++ b/src/ReC.Application/Endpoints/MappingProfile.cs @@ -3,11 +3,14 @@ using ReC.Domain.Entities; namespace ReC.Application.Endpoints; +// TODO: update to inject AddedWho from the current host/user contex public class MappingProfile : AutoMapper.Profile { public MappingProfile() { CreateMap() - .ForMember(e => e.Active, exp => exp.MapFrom(cmd => true)); + .ForMember(e => e.Active, exp => exp.MapFrom(cmd => true)) + .ForMember(e => e.AddedWhen, exp => exp.MapFrom(cmd => DateTime.UtcNow)) + .ForMember(e => e.AddedWho, exp => exp.MapFrom(cmd => "ReC.API")); } }