public async Task <ActionResult <Tapanyag> > Post(Tapanyag tapanyag) { _context.tapanyagok.Add(tapanyag); await _context.SaveChangesAsync(); return(CreatedAtAction("Get", new { id = tapanyag.id }, tapanyag)); }
public async Task <IActionResult> Put(int id, Tapanyag tapanyag) { if (id != tapanyag.id) { return(BadRequest()); } _context.Entry(tapanyag).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TapanyagExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }