public async Task <ActionResult <CQItem> > PostCQItem(CQItem item) { _context.CQItems.Add(item); await _context.SaveChangesAsync(); return(CreatedAtAction(nameof(GetCQItem), new CQItem { id = item.id }, item)); }
public async Task <IActionResult> PutCQItem(long id, CQItem item) { if (id != item.id) { return(BadRequest()); } _context.Entry(item).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }