public async Task <ActionResult <TacheEv> > PostTacheEv(TacheEv tacheEv) { _context.tacheEvs.Add(tacheEv); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTacheEv", new { id = tacheEv.Id }, tacheEv)); }
public async Task <IActionResult> PutTacheEv(int id, TacheEv tacheEv) { if (id != tacheEv.Id) { return(BadRequest()); } _context.Entry(tacheEv).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TacheEvExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }