public List <iPow.Infrastructure.Crosscutting.Authorize.Dto.MvcActionDto> GetAllPermissionFromDb() { var allPermission = new List <iPow.Infrastructure.Crosscutting.Authorize.Dto.MvcActionDto>(); var allController = controllerRepository.GetList(); foreach (var item in allController) { var controllerAction = actionRepository.GetList().Where(e => e.ControllerId == item.Id); var controllerClass = controllerClassRepository.GetList().Where(e => e.Id == item.ClassId).FirstOrDefault(); foreach (var action in controllerAction) { var model = new iPow.Infrastructure.Crosscutting.Authorize.Dto.MvcActionDto(); model.ActionId = action.Id; model.ActionName = action.Name; model.ActionRemark = action.Remark; model.ControllerClassId = item.ClassId; model.ControllerClassName = controllerClass != null ? controllerClass.Name : "控制器没有分类"; model.ControllerId = item.Id; model.ControllerName = item.Name; model.ControllerRemark = item.Remark; allPermission.Add(model); } } return(allPermission); }
public List<iPow.Infrastructure.Crosscutting.Authorize.Dto.MvcActionDto> GetAllPermissionFromDb() { var allPermission = new List<iPow.Infrastructure.Crosscutting.Authorize.Dto.MvcActionDto>(); var allController = controllerRepository.GetList(); foreach (var item in allController) { var controllerAction = actionRepository.GetList().Where(e => e.ControllerId == item.Id); var controllerClass = controllerClassRepository.GetList().Where(e => e.Id == item.ClassId).FirstOrDefault(); foreach (var action in controllerAction) { var model = new iPow.Infrastructure.Crosscutting.Authorize.Dto.MvcActionDto(); model.ActionId = action.Id; model.ActionName = action.Name; model.ActionRemark = action.Remark; model.ControllerClassId = item.ClassId; model.ControllerClassName = controllerClass != null ? controllerClass.Name : "控制器没有分类"; model.ControllerId = item.Id; model.ControllerName = item.Name; model.ControllerRemark = item.Remark; allPermission.Add(model); } } return allPermission; }