public async Task <ActionResult <PayementDetail> > PostPayementDetail(PayementDetail payementDetail) { _context.PayementDetails.Add(payementDetail); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPayementDetail", new { id = payementDetail.PMId }, payementDetail)); }
public async Task <IActionResult> PutPayementDetail(int id, PayementDetail payementDetail) { if (id != payementDetail.PMId) { return(BadRequest()); } _context.Entry(payementDetail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PayementDetailExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }