public async Task <IActionResult> PutMstCrmCustomer([FromRoute] int id, [FromBody] MstCrmCustomer mstCrmCustomer) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mstCrmCustomer.CustomerId) { return(BadRequest()); } _context.Entry(mstCrmCustomer).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstCrmCustomerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMstCrmCustomer([FromBody] MstCrmCustomer mstCrmCustomer) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MstCrmCustomer.Add(mstCrmCustomer); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMstCrmCustomer", new { id = mstCrmCustomer.CustomerId }, mstCrmCustomer)); }