public async Task <ActionResult> Delete(int id) { var existe = await context.Generos.AnyAsync(x => x.Id == id); if (!existe) { return(NotFound()); } context.Remove(new Genero() { Id = id }); await context.SaveChangesAsync(); return(NoContent()); }