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

            Skill = await _skillRepository.GetByIdAsync(id.Value);

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

            Skill = await _skillRepository.GetByIdAsync(id.Value);

            if (Skill != null)
            {
                await _skillRepository.DeleteAsync(Skill);
            }

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