public async Task <GetManagePermissionsByNameOutput> GetManagePermissionsByName(GetManagePermissionsByNameInput input) { Expression <Func <ApiScope, object> >[] propertySelectors = new Expression <Func <ApiScope, object> >[] { e => e.ApiManageScope.ApiScopePermissions }; var apiScope = _apiScopeManager.GetApiScopes(propertySelectors).FirstOrDefault(e => e.Name == input.Name); if (apiScope == null) { return(new GetManagePermissionsByNameOutput() { ErrorMessage = "未找到Api域" }); } var permissionIds = apiScope.ApiManageScope.ApiScopePermissions.Select(e => e.PermissionId).ToList(); var apiScopePermissions = _permissionRepository.GetAllList(e => permissionIds.Contains(e.Id)); return(new GetManagePermissionsByNameOutput() { Permissions = _objectMapper.Map <List <PermissionDto> >(apiScopePermissions) }); }