From 6e68083a8dd339fb1e4df876c04b1ef1aee007b9 Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 3 Dec 2025 12:43:51 +0100 Subject: [PATCH] Set Active property to true in ObtainEndpointCommand map Updated the `MappingProfile` class to configure the mapping between `ObtainEndpointCommand` and `Endpoint` to explicitly set the `Active` property of `Endpoint` to `true` using the `ForMember` method. This ensures that the `Active` property is initialized to `true` during the mapping process, aligning with the intended default behavior for new `Endpoint` objects. --- src/ReC.API/Controllers/RecActionController.cs | 2 +- src/ReC.Application/Endpoints/MappingProfile.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ReC.API/Controllers/RecActionController.cs b/src/ReC.API/Controllers/RecActionController.cs index 5d49c08..524c886 100644 --- a/src/ReC.API/Controllers/RecActionController.cs +++ b/src/ReC.API/Controllers/RecActionController.cs @@ -37,7 +37,7 @@ public class RecActionController(IMediator mediator) : ControllerBase CancellationToken cancel, [FromBody] FakeRequest? request = null, [FromQuery] string endpointUri = "https://jsonplaceholder.typicode.com/posts", - [FromQuery] string? endpointPath = null, + [FromQuery] string? endpointPath = "1", [FromQuery] string type = "GET") { if (endpointPath is not null) diff --git a/src/ReC.Application/Endpoints/MappingProfile.cs b/src/ReC.Application/Endpoints/MappingProfile.cs index 68653a9..4e9d02e 100644 --- a/src/ReC.Application/Endpoints/MappingProfile.cs +++ b/src/ReC.Application/Endpoints/MappingProfile.cs @@ -7,6 +7,7 @@ public class MappingProfile : AutoMapper.Profile { public MappingProfile() { - CreateMap(); + CreateMap() + .ForMember(e => e.Active, exp => exp.MapFrom(cmd => true)); } }