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

            Statiune = await _context.Statiune.FirstOrDefaultAsync(m => m.ID == id);

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

            Statiune = await _context.Statiune.FindAsync(id);

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

            return(RedirectToPage("./Index"));
        }