Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        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());
        }
Exemplo n.º 3
0
        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"));
        }