public async Task <ActionResult <BanqCustomer> > PostBanqCustomer(BanqCustomer banqCustomer) { _context.BanqCustomer.Add(banqCustomer); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBanqCustomer", new { id = banqCustomer.Id }, banqCustomer)); }
public async Task <IActionResult> PutBanqCustomer(int id, BanqCustomer banqCustomer) { if (id != banqCustomer.Id) { return(BadRequest()); } _context.Entry(banqCustomer).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BanqCustomerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }