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

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

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

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

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

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