public async Task <ActionResult <TblGenre> > PostTblGenre(TblGenre tblGenre) { _context.TblGenre.Add(tblGenre); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTblGenre", new { id = tblGenre.IdGenre }, tblGenre)); }
public async Task <IActionResult> PutTblGenre(int id, TblGenre tblGenre) { if (id != tblGenre.IdGenre) { return(BadRequest()); } _context.Entry(tblGenre).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblGenreExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }