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

            UserEntity = await _userRepository.GetByIdAsync(id.Value);

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

            UserEntity = await _userRepository.GetByIdAsync(id.Value);

            if (User != null)
            {
                await _userRepository.DeleteAsync(UserEntity);
            }

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