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:
@@ -7,6 +7,7 @@ public class MappingProfile : AutoMapper.Profile
|
||||
{
|
||||
public MappingProfile()
|
||||
{
|
||||
CreateMap<ObtainEndpointCommand, Endpoint>();
|
||||
CreateMap<ObtainEndpointCommand, Endpoint>()
|
||||
.ForMember(e => e.Active, exp => exp.MapFrom(cmd => true));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user