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

            ColorsOfGloves = await _context.ColorsOfGloves
                             .Include(c => c.Gloves).FirstOrDefaultAsync(m => m.Id == id);

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

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

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

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

            ColorsOfGloves = await _context.ColorsOfGloves
                             .Include(c => c.Gloves).FirstOrDefaultAsync(m => m.Id == id);

            if (ColorsOfGloves == null)
            {
                return(NotFound());
            }
            ViewData["GlovesId"] = new SelectList(_context.Gloves, "Id", "Id");
            return(Page());
        }