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