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