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