public async Task <ActionResult <EvanItem> > PostEvanItem(EvanItem evanItem) { _context.EvanItems.Add(evanItem); await _context.SaveChangesAsync(); return(CreatedAtAction("GetEvanItem", new { id = evanItem.Id }, evanItem)); }
public async Task <IActionResult> PutEvanItem(long id, EvanItem evanItem) { if (id != evanItem.Id) { return(BadRequest()); } _context.Entry(evanItem).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EvanItemExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }