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

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

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

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

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

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