public async Task <ActionResult <paymentsource> > PostPaymentSource(paymentsource paymentsource) { _context.paymentsource.Add(paymentsource); await _context.SaveChangesAsync(); return(CreatedAtAction("Getpaymentsource", new { id = paymentsource.paymentSourceId }, paymentsource)); }
public async Task <IActionResult> PutPaymentSource(int id, paymentsource paymentsource) { if (id != paymentsource.paymentSourceId) { return(BadRequest()); } _context.Entry(paymentsource).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!paymentsourceExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }