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