public IActionResult Delete(int id) { var state = _customStateService.GetCustomSateById(id); if (state.DepartmentId != DepartmentId) { Unauthorized(); } _customStateService.Delete(state); return(RedirectToAction("Index")); }