-
-
Save dcomartin/5bbd38ba40e44778277d6880a26a41c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PickupHandler : IRequestHandler<Pickup> | |
{ | |
private readonly IShipmentRepository _shipmentRepository; | |
public PickupHandler(IShipmentRepository shipmentRepository) | |
{ | |
_shipmentRepository = shipmentRepository; | |
} | |
public async Task<Unit> Handle(Pickup request, CancellationToken cancellationToken) | |
{ | |
var shipment = await _shipmentRepository.Get(request.ShipmentId); | |
shipment.Pickup(request.StopId, request.Departed); | |
await _shipmentRepository.Save(shipment); | |
return Unit.Value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment