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

            ColorOfSlippers = await _context.ColorOfSlippers
                              .Include(c => c.Slippers).FirstOrDefaultAsync(m => m.Id == id);

            if (ColorOfSlippers == null)
            {
                return(NotFound());
            }
            return(Page());
        }
示例#2
0
        public async Task <IActionResult> OnPostAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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

            ColorOfSlippers = await _context.ColorOfSlippers
                              .Include(c => c.Slippers).FirstOrDefaultAsync(m => m.Id == id);

            if (ColorOfSlippers == null)
            {
                return(NotFound());
            }
            ViewData["SlippersId"] = new SelectList(_context.Slippers, "Id", "Id");
            return(Page());
        }