コード例 #1
0
        public async Task <IActionResult> OnGetAsync(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            League = _context.History.Leagues.League.FirstOrDefault(m => m.League_id == id);

            if (League == null)
            {
                return(NotFound());
            }
            return(Page());
        }
コード例 #2
0
        public async Task <IActionResult> OnPostAsync(string id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            League = _context.History.Leagues.League.Find(l => l.League_id == id);

            if (League != null)
            {
                _context.History.Leagues.League.Remove(League);
            }

            return(RedirectToPage("./Index"));
        }
コード例 #3
0
        public async Task <IActionResult> OnGetAsync(string id)
        {
            League = _context.History.Leagues.League.FirstOrDefault(m => m.League_id == id);

            return(Page());
        }