Example #1
0
        public async Task <IActionResult> OnGetAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ColorsOfBags = await _context.ColorsOfBags
                           .Include(c => c.Bag).FirstOrDefaultAsync(m => m.Id == id);

            if (ColorsOfBags == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Example #2
0
        public async Task <IActionResult> OnGetAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ColorsOfBags = await _context.ColorsOfBags
                           .Include(c => c.Bag).FirstOrDefaultAsync(m => m.Id == id);

            if (ColorsOfBags == null)
            {
                return(NotFound());
            }
            ViewData["BagId"] = new SelectList(_context.Bags, "Id", "Id");
            return(Page());
        }
Example #3
0
        public async Task <IActionResult> OnPostAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ColorsOfBags = await _context.ColorsOfBags.FindAsync(id);

            if (ColorsOfBags != null)
            {
                _context.ColorsOfBags.Remove(ColorsOfBags);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }