public async Task <IActionResult> PutPrdOrderPayment([FromRoute] int id, [FromBody] PrdOrderPayment prdOrderPayment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != prdOrderPayment.OrderPaymentId) { return(BadRequest()); } _context.Entry(prdOrderPayment).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrdOrderPaymentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostPrdOrderPayment([FromBody] PrdOrderPayment prdOrderPayment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.PrdOrderPayment.Add(prdOrderPayment); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPrdOrderPayment", new { id = prdOrderPayment.OrderPaymentId }, prdOrderPayment)); }