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