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()); }
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")); }
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()); }