public async Task <IActionResult> PostMstCrmCustomerComment([FromBody] MstCrmCustomerComment mstCrmCustomerComment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MstCrmCustomerComment.Add(mstCrmCustomerComment); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMstCrmCustomerComment", new { id = mstCrmCustomerComment.CustomerCommentId }, mstCrmCustomerComment)); }
public async Task <IActionResult> PutMstCrmCustomerComment([FromRoute] int id, [FromBody] MstCrmCustomerComment mstCrmCustomerComment) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mstCrmCustomerComment.CustomerCommentId) { return(BadRequest()); } _context.Entry(mstCrmCustomerComment).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstCrmCustomerCommentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }