Beispiel #1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TestRanking = await _context.TestRankings
                          .Include(t => t.Country).FirstOrDefaultAsync(m => m.Id == id);

            if (TestRanking == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Beispiel #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TestRanking = await _context.TestRankings.FindAsync(id);

            if (TestRanking != null)
            {
                _context.TestRankings.Remove(TestRanking);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Beispiel #3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TestRanking = await _context.TestRankings
                          .Include(t => t.Country).FirstOrDefaultAsync(m => m.Id == id);

            if (TestRanking == null)
            {
                return(NotFound());
            }
            ViewData["CountryId"] = new SelectList(_context.Countries, "Id", "CountryName");
            return(Page());
        }