Merged AutoMapper branch

This commit is contained in:
Cristiano
2025-11-13 14:44:28 +01:00
parent 6bc8281a37
commit 9684dbcbc7
9 changed files with 477 additions and 23 deletions

View File

@@ -10,7 +10,9 @@ public class GetDelivererRequest
public int DelivererId { get; set; }
}
public class GetDelivererEndpoint(PyroFetesDbContext database) : Endpoint<GetDelivererRequest, GetDelivererDto>
public class GetDelivererEndpoint(
PyroFetesDbContext database,
AutoMapper.IMapper mapper) : Endpoint<GetDelivererRequest, GetDelivererDto>
{
public override void Configure()
{
@@ -29,11 +31,7 @@ public class GetDelivererEndpoint(PyroFetesDbContext database) : Endpoint<GetDel
return;
}
await Send.OkAsync(new GetDelivererDto()
{
Id = deliverer.Id,
Transporter = deliverer.Transporter,
}, ct);
await Send.OkAsync(mapper.Map<GetDelivererDto>(deliverer), ct);
}
}