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

            SkillArea = await _skillAreaRepository.GetByIdAsync(id.Value);

            if (SkillArea == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Example #2
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            SkillArea = await _skillAreaRepository.GetByIdAsync(id.Value);

            if (SkillArea != null)
            {
                await _skillAreaRepository.DeleteAsync(SkillArea);
            }

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