public GetQueryPermissionsByNameOutput GetQueryPermissionsByName(GetQueryPermissionsByNameInput input)
        {
            Expression <Func <ApiScope, object> >[] propertySelectors = new Expression <Func <ApiScope, object> >[] {
                e => e.ApiQueryScope.ApiScopePermissions
            };

            var apiScope = _apiScopeManager.GetApiScopes(propertySelectors).FirstOrDefault(e => e.Name == input.Name);

            if (apiScope == null)
            {
                throw new UserFriendlyException("未找到Api域");
            }

            var permissionIds = apiScope.ApiQueryScope.ApiScopePermissions.Select(e => e.PermissionId).ToList();

            var apiScopePermissions = _permissionRepository.GetAllList(e => permissionIds.Contains(e.Id));

            return(new GetQueryPermissionsByNameOutput()
            {
                Permissions = _objectMapper.Map <List <PermissionDto> >(apiScopePermissions)
            });
        }
        public async Task <GetQueryPermissionsByNameOutput> GetQueryPermissionsByName(GetQueryPermissionsByNameInput input)
        {
            Expression <Func <ApiScope, object> >[] propertySelectors = new Expression <Func <ApiScope, object> >[] {
                e => e.ApiQueryScope.ApiScopePermissions
            };

            var apiScope = _apiScopeManager.GetApiScopes(propertySelectors).FirstOrDefault(e => e.Name == input.Name);

            if (apiScope == null)
            {
                return(new GetQueryPermissionsByNameOutput()
                {
                    ErrorMessage = "未找到Api域"
                });
            }

            var permissionIds = apiScope.ApiQueryScope.ApiScopePermissions.Select(e => e.PermissionId).ToList();

            var apiScopePermissions = _permissionRepository.GetAllList(e => permissionIds.Contains(e.Id));

            return(new GetQueryPermissionsByNameOutput()
            {
                Permissions = AutoMapper.Mapper.Map <List <PermissionDto> >(apiScopePermissions)
            });
        }