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