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

            ColorOfSandals = await _context.ColorOfSandals
                             .Include(c => c.Sandals).FirstOrDefaultAsync(m => m.Id == id);

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

            ColorOfSandals = await _context.ColorOfSandals
                             .Include(c => c.Sandals).FirstOrDefaultAsync(m => m.Id == id);

            if (ColorOfSandals == null)
            {
                return(NotFound());
            }
            ViewData["SandalsId"] = new SelectList(_context.Sandals, "Id", "Id");
            return(Page());
        }
Beispiel #3
0
        public async Task <IActionResult> OnPostAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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