コード例 #1
0
        public async Task <IActionResult> GetPayment([FromRoute] int id)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var payment = await PaymentResult.SingleOrDefaultAsync(m => m.Id == id);

            if (payment == null)
            {
                return(NotFound());
            }

            return(Ok(payment));
        }