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