예제 #1
0
        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());
        }
예제 #2
0
        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"));
        }
예제 #3
0
        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());
        }