//[ValidateAntiForgeryToken]
        public async Task <string> ReflectionController()
        {
            BaseResult baseResult = new BaseResult();

            try
            {
                List <SystemController> lstSystemController = new List <SystemController>();
                List <SystemAction>     lstSystemAction     = new List <SystemAction>();
                Assembly[]        arrAssembly             = AppDomain.CurrentDomain.GetAssemblies();
                List <MethodInfo> lstMethodInfoController = new List <MethodInfo>();
                for (int i = 0; i < arrAssembly.Length; i++)
                {
                    if (arrAssembly[i].GetName().Name.Equals("Microsoft.AspNetCore.Mvc.ViewFeatures"))
                    {
                        foreach (Type item in arrAssembly[i].GetModule("Microsoft.AspNetCore.Mvc.ViewFeatures.dll").GetTypes())
                        {
                            if (item.Name.Equals("Controller"))
                            {
                                lstMethodInfoController.AddRange(item.GetMethods());
                                break;
                            }
                        }
                    }
                }
                for (int i = 0; i < arrAssembly.Length; i++)
                {
                    if (arrAssembly[i].GetName().Name.Equals("Message.UI"))
                    {
                        foreach (Type item in arrAssembly[i].GetModule("Message.UI.dll").GetTypes())
                        {
                            if (!string.IsNullOrWhiteSpace(item.Namespace))
                            {
                                if (item.Namespace.ToString().Equals("Message.UI.Areas.Admin.Controllers") && item.Name.EndsWith("Controller"))
                                {
                                    if (item.Name == "BaseAdminController")
                                    {
                                        continue;
                                    }
                                    SystemController entity = new SystemController()
                                    {
                                        ScontrollerName = item.Name.Replace("Controller", string.Empty)
                                    };
                                    if (entity.ScontrollerName == "System")
                                    {
                                        entity.ScontrollerName += "Controller";
                                    }
                                    lstSystemController.Add(entity);
                                    SystemController entitySystemController = await _SystemControllerService.SelectAsync(new SystemController()
                                    {
                                        ScontrollerName = entity.ScontrollerName
                                    });

                                    if (entitySystemController == null)
                                    {
                                        await _SystemControllerService.AppendAsync(entity, User.Identity.Name);
                                    }
                                    else
                                    {
                                        entity.Id = entitySystemController.Id;
                                    }
                                    foreach (MethodInfo entityMethodInfo in item.GetMethods(BindingFlags.Instance | BindingFlags.Public))
                                    {
                                        if (!lstMethodInfoController.Exists(x => x.Name.Equals(entityMethodInfo.Name)))
                                        {
                                            SystemAction entitySystemAction = new SystemAction()
                                            {
                                                IcontrollerId = entity.Id,
                                                SactionName   = entityMethodInfo.Name,
                                                SresultType   = entityMethodInfo.ReturnType.Name
                                            };
                                            if (_systemActionService.Select(entitySystemAction) == null)
                                            {
                                                await _systemActionService.AppendAsync(entitySystemAction, User.Identity.Name);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                baseResult.Code = 0;
                baseResult.Msg  = "操作成功!";
            }
            catch (Exception ex)
            {
                baseResult.Code = 3;
                baseResult.Msg  = ex.Message;
                throw;
            }
            return(JsonHelper.ObjectToJSON(baseResult));
        }
 public PageInfo <ViewMenuAction> GetPageList(PageInfo <ViewMenuAction> pageInfo, ViewMenuAction oSearchEntity = null, string sOperator = null, int iOrderGroup = 0, string sSortName = null, string sSortOrder = null)
 {
     if (string.IsNullOrWhiteSpace(oSearchEntity.ScontrollerName))
     {
         if (!string.IsNullOrWhiteSpace(oSearchEntity.SmenuName))
         {
             Menu entityMenu = _menuService.Select(new Menu()
             {
                 Sname = oSearchEntity.SmenuName
             });
             if (entityMenu != null)
             {
                 oSearchEntity.ImenuId = entityMenu.Id;
             }
         }
         pageInfo = _mapper.Map <PageInfo <ViewMenuAction> >(_menuActionRepository.GetPageList(_mapper.Map <PageInfo <MenuAction> >(pageInfo), _mapper.Map <MenuAction>(oSearchEntity), sOperator, iOrderGroup, sSortName, sSortOrder));
     }
     else
     {
         SystemController entitySystemController = _systemControllerService.Select(new SystemController()
         {
             ScontrollerName = oSearchEntity.ScontrollerName
         });
         if (entitySystemController != null)
         {
             List <SystemAction> lstSystemAction = _systemActionService.SelectALL(new SystemAction()
             {
                 IcontrollerId = entitySystemController.Id
             });
             foreach (SystemAction entitySystemAction in lstSystemAction)
             {
                 MenuAction entityMenuAction = _menuActionRepository.Select(new MenuAction()
                 {
                     IactionId = entitySystemAction.Id
                 });
                 if (entityMenuAction != null)
                 {
                     List <ViewMenuAction> lstViewMenuAction = new List <ViewMenuAction>();
                     lstViewMenuAction.Add(_mapper.Map <ViewMenuAction>(entityMenuAction));
                     pageInfo.data  = lstViewMenuAction;
                     pageInfo.count = lstViewMenuAction.Count;
                 }
             }
         }
     }
     if (pageInfo.data?.Count > 0)
     {
         foreach (ViewMenuAction entityViewMenuAction in pageInfo.data)
         {
             Menu entityMenu = _menuService.Select(entityViewMenuAction.ImenuId);
             if (entityMenu != null)
             {
                 entityViewMenuAction.SmenuName = entityMenu.Sname;
             }
             SystemAction entitySystemAction = _systemActionService.Select(entityViewMenuAction.IactionId);
             if (entitySystemAction != null)
             {
                 SystemController entitySystemController = _systemControllerService.Select(entitySystemAction.IcontrollerId);
                 if (entitySystemController != null)
                 {
                     entityViewMenuAction.ScontrollerName = entitySystemController.ScontrollerName;
                     entityViewMenuAction.SactionName     = "/" + entitySystemController.ScontrollerName + "/" + entitySystemAction.SactionName + "?iMethodId=" + entitySystemAction.Id;
                 }
             }
         }
     }
     return(pageInfo);
 }