public async Task <GetTransferRequestQueryResponse> Handle(GetTransferRequestQueryRequest message) { TransferRequest transferRequest = null; switch (message.CallerType) { case CallerType.TransferReceiver: transferRequest = await _commitmentsApi.GetTransferRequestForReceiver(message.AccountId, message.TransferRequestId); break; case CallerType.TransferSender: transferRequest = await _commitmentsApi.GetTransferRequestForSender(message.AccountId, message.TransferRequestId); break; default: throw new BadRequestException("Only Getting a Transfer Request as a Sender is supported", null); } return(new GetTransferRequestQueryResponse { TransferRequest = transferRequest }); }