public async Task <IActionResult> PutCustomerFeedBack([FromRoute] int id, [FromBody] CustomerFeedBack customerFeedBack) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != customerFeedBack.ID) { return(BadRequest()); } _context.Entry(customerFeedBack).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerFeedBackExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostCustomerFeedBack([FromBody] CustomerFeedBack customerFeedBack) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.CustomerFeeds.Add(customerFeedBack); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCustomerFeedBack", new { id = customerFeedBack.ID }, customerFeedBack)); }