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