public async Task <ActionResult <KeyWordDetail> > PostKeyWordDetail(KeyWordDetail KeyWordDetail) { _context.KeyWordDetails.Add(KeyWordDetail); await _context.SaveChangesAsync(); return(CreatedAtAction("GetKeyWordDetail", new { id = KeyWordDetail.KWId }, KeyWordDetail)); }
public async Task <IActionResult> PutKeyWordDetail(int id, KeyWordDetail KeyWordDetail) { if (id != KeyWordDetail.KWId) { return(BadRequest()); } _context.Entry(KeyWordDetail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!KeyWordDetailExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }