public async Task <IActionResult> PutGenero(int id, Genero genero) { if (id != genero.IdGenero) { return(BadRequest()); } _context.Entry(genero).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GeneroExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutFilme(int id, Filme filme) { if (id != filme.Tconst) { return(BadRequest()); } _context.Entry(filme).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FilmeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task SaveAsync() { await context.SaveChangesAsync(); }