Beispiel #1
0
        public IActionResult OnGet()
        {
            ViewData["MaterialID"] = new SelectList(_context.Set <Material>(), "ID", "DenumireMaterial");
            var bijuterie = new Bijuterie();

            bijuterie.BijuterieCategories = new List <BijuterieCategory>();
            PopulateAssignedCategoryData(_context, bijuterie);
            return(Page());
        }
Beispiel #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Bijuterie = await _context.Bijuterie
                        .Include(b => b.BijuterieCategories).ThenInclude(b => b.Category)
                        .AsNoTracking()
                        .FirstOrDefaultAsync(m => m.ID == id);

            if (Bijuterie == null)
            {
                return(NotFound());
            }
            PopulateAssignedCategoryData(_context, Bijuterie);

            ViewData["MaterialID"] = new SelectList(_context.Set <Material>(), "ID", "DenumireMaterial");
            return(Page());
        }