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