Exemple #1
0
 public IActionResult Put(int id, [FromBody] Payment value)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     _paymentsRepository.Update(id, value);
     return(Ok());
 }
        public async Task <IActionResult> Update(string id, [FromBody] Payment payment)
        {
            if (payment == null || payment.Id != id)
            {
                return(BadRequest());
            }

            if (await _paymentsRepository.Get(id) == null)
            {
                return(NotFound());
            }

            await _paymentsRepository.Update(payment);

            return(new NoContentResult());
        }