public ActionResult <string> Get(int id) { var payment = _paymentsRepository.GetPaymentById(id); if (payment == null) { return(NoContent()); } return(Ok(payment)); }
public async Task <PaymentResponse> GetPaymentById(string id) { if (string.IsNullOrEmpty(id)) { return(null); } try { var payment = await _paymentsRepo.GetPaymentById(id); return(_mapper.Map <PaymentResponse>(payment)); } catch (Exception e) { return(null); } }