public static void delet(Models.Alunos pAluno) { DataBase db = getDataBase(); var query = from e in db.Estrelas where e.IdAluno == pAluno.IdAluno select e; db.Estrelas.DeleteOnSubmit(query.ToList()[0]); db.SubmitChanges(); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Alunos = await _context.Alunos.SingleOrDefaultAsync(m => m.id == id); if (Alunos == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Alunos = await _context.Alunos.FindAsync(id); if (Alunos != null) { _context.Alunos.Remove(Alunos); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }