public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Centro_educativo = await _context.Centro_Educativo.FirstOrDefaultAsync(m => m.CentroId == id); if (Centro_educativo == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Centro_educativo = await _context.Centro_Educativo.FindAsync(id); if (Centro_educativo != null) { _context.Centro_Educativo.Remove(Centro_educativo); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }