public async Task <IActionResult> Delete(EmployeeDepartmentViewModel employeeDepartmentVM)
        {
            await _employeeDeparment.DeleteEmployeeDepartment(employeeDepartmentVM.EmployeeDepartment);

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

            //return RedirectToAction(nameof(Index));

            return(Redirect(employeeDepartmentVM.ReturnUrl));
        }
        public async Task <ActionResult> DeleteEmployeeDepartment(int Id)
        {
            var EmployeeDepartmentFromRepo = await _EmployeeDepartmentRepository.GetEmployeeDepartmentAsync(Id);

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

            _EmployeeDepartmentRepository.DeleteEmployeeDepartment(EmployeeDepartmentFromRepo);
            await _EmployeeDepartmentRepository.SaveAsync();

            return(NoContent());
        }