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

            Designation = await _context.Designations.FirstOrDefaultAsync(m => m.ID == id);

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

            Designation = await _context.Designations.FindAsync(id);

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

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