public async Task <IActionResult> OnGetAsync(Guid?id) { if (id == null) { return(NotFound()); } CategoryOfJewelry = await _context.CategoryOfJewelry .Include(c => c.Jewelry).FirstOrDefaultAsync(m => m.Id == id); if (CategoryOfJewelry == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(Guid?id) { if (id == null) { return(NotFound()); } CategoryOfJewelry = await _context.CategoryOfJewelry .Include(c => c.Jewelry).FirstOrDefaultAsync(m => m.Id == id); if (CategoryOfJewelry == null) { return(NotFound()); } ViewData["JewelryId"] = new SelectList(_context.Jewelry, "Id", "Id"); return(Page()); }
public async Task <IActionResult> OnPostAsync(Guid?id) { if (id == null) { return(NotFound()); } CategoryOfJewelry = await _context.CategoryOfJewelry.FindAsync(id); if (CategoryOfJewelry != null) { _context.CategoryOfJewelry.Remove(CategoryOfJewelry); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }