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.
This commit is contained in:
parent
b67da5434e
commit
6e68083a8d
@ -37,7 +37,7 @@ public class RecActionController(IMediator mediator) : ControllerBase
|
|||||||
CancellationToken cancel,
|
CancellationToken cancel,
|
||||||
[FromBody] FakeRequest? request = null,
|
[FromBody] FakeRequest? request = null,
|
||||||
[FromQuery] string endpointUri = "https://jsonplaceholder.typicode.com/posts",
|
[FromQuery] string endpointUri = "https://jsonplaceholder.typicode.com/posts",
|
||||||
[FromQuery] string? endpointPath = null,
|
[FromQuery] string? endpointPath = "1",
|
||||||
[FromQuery] string type = "GET")
|
[FromQuery] string type = "GET")
|
||||||
{
|
{
|
||||||
if (endpointPath is not null)
|
if (endpointPath is not null)
|
||||||
|
|||||||
@ -7,6 +7,7 @@ public class MappingProfile : AutoMapper.Profile
|
|||||||
{
|
{
|
||||||
public MappingProfile()
|
public MappingProfile()
|
||||||
{
|
{
|
||||||
CreateMap<ObtainEndpointCommand, Endpoint>();
|
CreateMap<ObtainEndpointCommand, Endpoint>()
|
||||||
|
.ForMember(e => e.Active, exp => exp.MapFrom(cmd => true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user