public IActionResult OnGet() { ViewData["BrandID"] = new SelectList(_context.Set <Brand>(), "ID", "NumeBrand"); ViewData["GenID"] = new SelectList(_context.Set <Gen>(), "ID", "NumeGen"); var parfum = new Parfum(); parfum.AromeParfum = new List <AromaParfum>(); PopulateAtributAromaData(_context, parfum); return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Parfum = await _context.Parfum .Include(b => b.Brand) .Include(b => b.Gen) .Include(b => b.AromeParfum).ThenInclude(b => b.Aroma) .AsNoTracking() .FirstOrDefaultAsync(m => m.ID == id); if (Parfum == null) { return(NotFound()); } PopulateAtributAromaData(_context, Parfum); ViewData["BrandID"] = new SelectList(_context.Set <Brand>(), "ID", "NumeBrand"); ViewData["GenID"] = new SelectList(_context.Set <Gen>(), "ID", "NumeGen"); return(Page()); }