public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } MathHack = await _context.MathHack .Include(m => m.Industry).FirstOrDefaultAsync(m => m.Id == id); if (MathHack == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } MathHack = await _context.MathHack.FindAsync(id); if (MathHack != null) { _context.MathHack.Remove(MathHack); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } MathHack = await _context.MathHack .Include(m => m.Industry).FirstOrDefaultAsync(m => m.Id == id); if (MathHack == null) { return(NotFound()); } ViewData["IndustryId"] = new SelectList(_context.Set <Industry>(), "Id", "Name"); return(Page()); }