Ejemplo n.º 1
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            EducationLevel = await _context.EducationLevel.FirstOrDefaultAsync(m => m.ElId == id);

            if (EducationLevel == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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