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

            Admin = await _adminRepository.GetByIdAsync(id.Value);

            if (Admin != null)
            {
                await _adminRepository.DeleteAsync(Admin);
            }

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

            Admin = await _adminRepository.GetByIdAsync(id.Value);

            Admin.Email = EncryptionHelper.Decrypt(Admin.Email);

            if (Admin == null)
            {
                return(NotFound());
            }
            return(Page());
        }