public async Task <ActionResult <MediasEv> > PostMediasEv(MediasEv mediasEv) { _context.mediasEvs.Add(mediasEv); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMediasEv", new { id = mediasEv.Id }, mediasEv)); }
public async Task <IActionResult> PutMediasEv(int id, MediasEv mediasEv) { if (id != mediasEv.Id) { return(BadRequest()); } _context.Entry(mediasEv).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MediasEvExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }