public async Task <ActionResult <CustomerTb> > PostCustomerTb(CustomerTb customerTb) { _context.CustomerTb.Add(customerTb); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCustomerTb", new { id = customerTb.CustomerId }, customerTb)); }
public async Task <IActionResult> PutCustomerTb(int id, CustomerTb customerTb) { if (id != customerTb.CustomerId) { return(BadRequest()); } _context.Entry(customerTb).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerTbExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }