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"`.
This commit is contained in:
parent
6e68083a8d
commit
1e21d133ae
@ -3,11 +3,14 @@ using ReC.Domain.Entities;
|
|||||||
|
|
||||||
namespace ReC.Application.Endpoints;
|
namespace ReC.Application.Endpoints;
|
||||||
|
|
||||||
|
// TODO: update to inject AddedWho from the current host/user contex
|
||||||
public class MappingProfile : AutoMapper.Profile
|
public class MappingProfile : AutoMapper.Profile
|
||||||
{
|
{
|
||||||
public MappingProfile()
|
public MappingProfile()
|
||||||
{
|
{
|
||||||
CreateMap<ObtainEndpointCommand, Endpoint>()
|
CreateMap<ObtainEndpointCommand, Endpoint>()
|
||||||
.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"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user