Esempio n. 1
0
        public async Task <IActionResult> Delete(RegisterControlViewModel registerControlVM)
        {
            await _registerControlRepo.DeleteRegisterControl(registerControlVM.RegisterControl);

            TempData["message"]     = "Your data has been deleted successfully.";
            TempData["toasterType"] = ToasterType.success;

            //return RedirectToAction(nameof(Index));

            return(Redirect(registerControlVM.ReturnUrl));
        }
Esempio n. 2
0
        public async Task <ActionResult> DeleteRegisterControl(int id)
        {
            var registerControlFromRepo = await _registerControlRepository.GetRegisterControlAsync(id);

            if (registerControlFromRepo == null)
            {
                return(NotFound());
            }

            _registerControlRepository.DeleteRegisterControl(registerControlFromRepo);
            await _registerControlRepository.SaveAsync();

            return(NoContent());
        }