Пример #1
0
        public async Task <IActionResult> GetRelatedPaymentByIdAsync(int depositId)
        {
            PaymentDto paymentDto;

            try
            {
                var payment = await _paymentManager.GetByDepositIdAsync(depositId);

                paymentDto = _mapper.Map <PaymentDto>(payment);
            }
            catch (EntityNotFoundException)
            {
                paymentDto = null;
            }

            var links = _jsonApiBuilder.BuildSingleResourceLinks(HttpContext.Request.Path);

            return(Ok(new ResourceResponse()
            {
                Links = links, Data = paymentDto
            }));
        }