public async Task <ActionResult <ASPItem> > PostItem(ASPItem todoItem) { _context.ASPItems.Add(todoItem); await _context.SaveChangesAsync(); return(CreatedAtAction("PostItem", new { id = todoItem.Id }, todoItem)); }
public async Task <IActionResult> PutItem(long id, ASPItem todoItem) { if (id != todoItem.Id) { return(BadRequest()); } _context.Entry(todoItem).State = EntityState.Modified; await _context.SaveChangesAsync(); return(NoContent()); }