Пример #1
0
        public async Task <IActionResult> OnGetAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PanthsColor = await _context.PanthsColor.FirstOrDefaultAsync(m => m.Id == id);

            if (PanthsColor == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Пример #2
0
        public async Task <IActionResult> OnPostAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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