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