public async Task <ActionResult <CreditUnion> > PostCreditUnion(CreditUnion item) { _context.CreditUnions.Add(item); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetCreditUnion), new { id = item.Id }, item)); }
public async Task <IActionResult> PutPaymentHistory(Guid id, PaymentHistory paymentHistory) { if (id != paymentHistory.Id) { return(BadRequest()); } _context.Entry(paymentHistory).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PaymentHistoryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }