Przeglądaj źródła

Merge branch 'release/3.1.1' of Vit-Orm/Vit.Linq into master

LithWang 8 miesięcy temu
rodzic
commit
925df79d3c
26 zmienionych plików z 308 dodań i 284 usunięć
  1. 86 0
      Publish/DevOps3/build-bash/10.Test.bash
  2. 5 6
      Publish/DevOps3/build-bash/30.nuget-pack.sh
  3. 11 12
      Publish/DevOps3/build-bash/40.Station-publish.sh
  4. 0 31
      Publish/DevOps3/build-cmd/40.Station-publish(net5.0).bat
  5. 0 31
      Publish/DevOps3/build-cmd/40.Station-publish(netcoreapp2.1).bat
  6. 0 97
      Publish/DevOps3/build-cmd/41.StressTest-publish.bat
  7. 22 0
      Publish/DevOps3/environment/README.md
  8. 20 0
      Publish/DevOps3/environment/build-bash__10.Test__#1.InitEnv.sh.bak
  9. 16 0
      Publish/DevOps3/environment/build-bash__10.Test__#3.CleanEnv.sh.bak
  10. 21 0
      Publish/DevOps3/environment/build-bash__40.Station-publish__#4_copyExtraReleaseFiles.sh.bak
  11. 20 0
      Publish/DevOps3/environment/build-bash__41.extra-publish.sh.bak
  12. 17 0
      Publish/DevOps3/environment/build-bash__52.docker-extra-copy.sh.bak
  13. 2 0
      Publish/DevOps3/environment/jenkins_NoNeedApprovalForBuild.txt
  14. 0 13
      Publish/DevOps3/environment/readme.md
  15. 4 0
      Publish/DevOps3/github-bash/startup.bash
  16. 30 29
      Publish/DevOps3/jenkins-bash/CICD.ki.git_Multibranch.deploy.jenkinsfile
  17. 8 8
      README.md
  18. 0 7
      Vit.Linq.sln
  19. 8 8
      doc/README_CN.md
  20. 16 0
      src/Vit.Linq/ExpressionNodes/ComponentModel/ExpressionNode/ExpressionNode_Lambda.cs
  21. 1 1
      src/Vit.Linq/ExpressionNodes/ExpressionConvertor/Lambda.cs
  22. 5 3
      src/Vit.Linq/QueryableBuilder.cs
  23. 2 2
      src/Vit.Linq/Vit.Linq.csproj
  24. 7 3
      test/Vit.Linq.ExpressionNodes.MsTest/Vit.Linq.ExpressionNodes.MsTest.csproj
  25. 7 3
      test/Vit.Linq.MsTest/Vit.Linq.MsTest.csproj
  26. 0 30
      test/Vit.Linq.MsTest31/Vit.Linq.MsTest31.csproj

+ 86 - 0
Publish/DevOps3/build-bash/10.Test.bash

@@ -0,0 +1,86 @@
+set -e
+
+
+#---------------------------------------------------------------------
+# args
+args_="
+
+export basePath=/root/temp/svn
+export NUGET_PATH=$basePath/Publish/release/.nuget
+
+# "
+
+
+#----------------------------------------------
+# init args
+if [ -z "$basePath" ]; then export basePath=$PWD/../../..; fi
+export devOpsPath="$PWD/.."
+
+if [ ! $NUGET_PATH ]; then NUGET_PATH=$basePath/Publish/release/.nuget; fi
+
+
+#----------------------------------------------
+echo "#10.Test.bash -> #1 init test environment"
+bashFile="$devOpsPath/environment/build-bash__10.Test__#1.InitEnv.sh"
+if [ -f "$bashFile" ]; then
+	echo "#10.Test.bash -> #1 init test environment - Run bash"
+	sh "$bashFile"
+fi
+
+
+#----------------------------------------------
+echo "#10.Test.bash -> #2 find test projects and run test"
+
+docker run -i --rm \
+--net=host \
+--env LANG=C.UTF-8 \
+-v $NUGET_PATH:/root/.nuget \
+-v "$basePath":/root/code \
+-v "$basePath":"$basePath" \
+serset/dotnet:sdk-6.0 \
+bash -c "
+set -e
+
+cd /root/code
+
+#2.1 skip if no test projects
+if grep '<test>' -r --include *.csproj; then
+	echo '#10.Test.bash -> got projects need to test'
+else
+	echo '#10.Test.bash -> skip for no project needs to test'
+	exit 0
+fi
+
+#2.2 run test
+echo '#10.Test.bash -> #2.2 run test...'
+for file in \$(grep -a '<test>' . -rl --include *.csproj)
+do
+	echo '#10.Test.bash -> #2.2.1 run test:'
+	echo run test for project \"\$file\"
+
+	# run test
+	cd /root/code
+	cd \$(dirname \"\$file\")
+	dotnet test
+done
+
+
+"
+#----------------------------------------------
+echo "#10.Test.bash -> #3 clean test environment"
+bashFile="$devOpsPath/environment/build-bash__10.Test__#3.CleanEnv.sh"
+if [ -f "$bashFile" ]; then
+	echo "#10.Test.bash -> #1 Clean test environment - Run bash"
+	sh "$bashFile"
+fi
+
+
+
+#----------------------------------------------
+
+echo '#10.Test.bash -> success!'
+
+
+
+
+

+ 5 - 6
Publish/DevOps3/build-bash/30.nuget-pack.sh

@@ -15,10 +15,6 @@ export NUGET_PATH=$basePath/Publish/release/.nuget
 if [ ! $NUGET_PATH ]; then NUGET_PATH=$basePath/Publish/release/.nuget; fi
 
 
-nugetPath=Publish/release/release/nuget
-mkdir -p $basePath/Publish/release/release
-
-
 
 #----------------------------------------------
 echo "30.nuget-pack.sh"
@@ -28,15 +24,18 @@ docker run -i --rm \
 -v $basePath:/root/code \
 serset/dotnet:sdk-6.0 \
 bash -c "
+
+publishPath=/root/code/Publish/release/release/nuget
+
 cd /root/code
 for file in \$(grep -a '<pack>nuget</pack>' . -rl --include *.csproj)
 do
 	echo pack \$file
-	mkdir -p /root/code/$nugetPath
+	mkdir -p \$publishPath
 	cd /root/code
 	cd \$(dirname \"\$file\")
 	dotnet build --configuration Release
-	dotnet pack --configuration Release --output '/root/code/$nugetPath'
+	dotnet pack --configuration Release --output \"\$publishPath\"
 done
 "
 

+ 11 - 12
Publish/DevOps3/build-bash/40.Station-publish.sh

@@ -27,7 +27,9 @@ serset/dotnet:sdk-6.0 \
 bash -c "
 set -e
 
-if grep '<publish>' -r --include *.csproj /root/code; then
+cd /root/code
+
+if grep '<publish>' -r --include *.csproj; then
 	echo '#40.Station-publish.sh -> got projects need to be built'
 else
 	echo '#40.Station-publish.sh -> skip for no project needs to be built'
@@ -35,26 +37,23 @@ else
 fi
 
 echo '#1 get netVersion'
-export netVersion=\$(grep '<TargetFramework>' \$(grep '<publish>' -rl --include *.csproj /root/code | head -n 1) | grep -oP '>(.*)<' | tr -d '<>')
+export netVersion=\$(grep '<TargetFramework>' \$(grep '<publish>' -rl --include *.csproj | head -n 1) | grep -oP '>(.*)<' | tr -d '<>')
 echo netVersion: \$netVersion
 
 
-export basePath=/root/code
-export publishPath=\$basePath/Publish/release/release/Station\(\$netVersion\)
+export publishPath=/root/code/Publish/release/release/Station\(\$netVersion\)
 mkdir -p \$publishPath
 
 echo '#2 publish station'
-cd \$basePath
 for file in \$(grep -a '<publish>' . -rl --include *.csproj)
-do
-	cd \$basePath
-	
-	#get publishName
+do	
+	# get publishName
+	cd /root/code
 	publishName=\`grep '<publish>' \$file -r | grep -oP '>(.*)<' | tr -d '<>'\`
 
 	echo publish \$publishName
 
-	#publish
+	# publish
 	cd \$(dirname \"\$file\")
 	dotnet build --configuration Release
 	dotnet publish --configuration Release --output \"\$publishPath/\$publishName\"
@@ -65,9 +64,9 @@ done
 
 
 #3 copy station release files
-if [ -d \"\$basePath/Publish/ReleaseFile/Station\" ]; then
+if [ -d \"\/root/code/Publish/ReleaseFile/Station\" ]; then
 	echo '#3 copy station release files'
-	\cp -rf \$basePath/Publish/ReleaseFile/Station/. \"\$publishPath\"
+	\cp -rf \/root/code/Publish/ReleaseFile/Station/. \"\$publishPath\"
 fi
 
 

+ 0 - 31
Publish/DevOps3/build-cmd/40.Station-publish(net5.0).bat

@@ -1,31 +0,0 @@
-@echo off
-
-
-:: #1 init
-set netVersion=net5.0
-
-
-:: #2 change netcore version
-VsTool.exe replace -r --path "../../.." --file "App.Gateway.csproj|App.Gover.Gateway.csproj|App.ServiceCenter.csproj|Did.SersLoader.Demo.csproj|App.Robot.Station.csproj" --old "<TargetFramework>net6.0</TargetFramework>" --new "<TargetFramework>%netVersion%</TargetFramework>"
-
-
-
-
-
-:: #3 publish
-call "40.Station-publish.bat"
-
-
-
-
-
-
-:: #4 revert netcore version
-VsTool.exe replace -r --path "../../.." --file "App.Gateway.csproj|App.Gover.Gateway.csproj|App.ServiceCenter.csproj|Did.SersLoader.Demo.csproj|App.Robot.Station.csproj" --old "<TargetFramework>%netVersion%</TargetFramework>" --new "<TargetFramework>net6.0</TargetFramework>"
-
-
-
-
-
-echo %~n0.bat success
-cd /d "%curPath%"

+ 0 - 31
Publish/DevOps3/build-cmd/40.Station-publish(netcoreapp2.1).bat

@@ -1,31 +0,0 @@
-@echo off
-
-
-:: #1 init
-set netVersion=netcoreapp2.1
-
-
-:: #2 change netcore version
-VsTool.exe replace -r --path "../../.." --file "App.Gateway.csproj|App.Gover.Gateway.csproj|App.ServiceCenter.csproj|Did.SersLoader.Demo.csproj|App.Robot.Station.csproj" --old "<TargetFramework>net6.0</TargetFramework>" --new "<TargetFramework>%netVersion%</TargetFramework>"
-
-
-
-
-
-:: #3 publish
-call "40.Station-publish.bat"
-
-
-
-
-
-
-:: #4 revert netcore version
-VsTool.exe replace -r --path "../../.." --file "App.Gateway.csproj|App.Gover.Gateway.csproj|App.ServiceCenter.csproj|Did.SersLoader.Demo.csproj|App.Robot.Station.csproj" --old "<TargetFramework>%netVersion%</TargetFramework>" --new "<TargetFramework>net6.0</TargetFramework>"
-
-
-
-
-
-echo %~n0.bat success
-cd /d "%curPath%"

+ 0 - 97
Publish/DevOps3/build-cmd/41.StressTest-publish.bat

@@ -1,97 +0,0 @@
-@echo off
-
-::enable delayed arguments
-setlocal EnableDelayedExpansion
-
-
-
-:: #1 get 获取basePath
-set curPath=%cd%
-cd /d "%~dp0"
-cd /d ../../..
-set basePath=%cd%
-
-
-
-:: #2
-set publishPath=%basePath%/Publish/release/release/StressTest
-
-
-
-
-
-echo ------------------------------------------------------------------
-echo "#3 publish CL stressTest"
-
-::Client
-cd /d "%basePath%\dotnet\Library\Sers\Sers.CL\Test\CommunicationManage\CmClient"
-dotnet build --configuration Release
-dotnet publish --configuration Release --output "%publishPath%\CL压测net6.0\CmClient"
-@if errorlevel 1 (echo . & echo .  & echo error & pause) 
-
-::Server
-cd /d "%basePath%\dotnet\Library\Sers\Sers.CL\Test\CommunicationManage\CmServer"
-dotnet build --configuration Release
-dotnet publish --configuration Release --output "%publishPath%\CL压测net6.0\CmServer"
-@if errorlevel 1 (echo . & echo .  & echo error & pause) 
-
-
-::copy bat
-xcopy  "%basePath%\Publish\ReleaseFile\StressTest\CL压测" "%publishPath%\CL压测net6.0" /e /i /r /y
-
-
-
-
-echo ------------------------------------------------------------------
-:: #4 publish Sers stressTest
-for %%i in (net6.0) do (  
-	set netVersion=%%i
-	set appPath=%basePath%/Publish/release/release/Station^(!netVersion!^)
-
-	echo 发布 压测-!netVersion!
-
-	::单体压测
-	set targetPath=%publishPath%/单体压测!netVersion!
-
-	::(x.x.1)copy ServiceCenter
-	xcopy "!appPath!\ServiceCenter" "!targetPath!\ServiceCenter" /e /i /r /y
-
-	::(x.x.2)copy demo
-	xcopy "!appPath!\Demo\wwwroot" "!targetPath!\ServiceCenter\wwwroot" /e /i /r /y
-	xcopy "!appPath!\Demo\Did.SersLoader.Demo.dll" "!targetPath!\ServiceCenter" /i /r /y
-	xcopy "!appPath!\Demo\Did.SersLoader.Demo.pdb" "!targetPath!\ServiceCenter" /i /r /y
-	xcopy "!appPath!\Demo\Did.SersLoader.Demo.xml" "!targetPath!\ServiceCenter" /i /r /y
-
-	::(x.x.3)copy Robot
-	xcopy "!appPath!\Robot\wwwroot" "!targetPath!\ServiceCenter\wwwroot" /e /i /r /y
-	xcopy "!appPath!\Robot\App.Robot.Station.dll" "!targetPath!\ServiceCenter" /i /r /y
-	xcopy "!appPath!\Robot\App.Robot.Station.pdb" "!targetPath!\ServiceCenter" /i /r /y
-	xcopy "!appPath!\Robot\App.Robot.Station.xml" "!targetPath!\ServiceCenter" /i /r /y
-
-	::(x.x.4)copy ReleaseFile
-	xcopy "%basePath%\Publish\ReleaseFile\StressTest\单体压测" "!targetPath!" /e /i /r /y
-
-
-
-	::分布式压测
-	set targetPath=%publishPath%/分布式压测!netVersion!
-
-	::(x.x.1)copy  station
-	xcopy "!appPath!\ServiceCenter" "!targetPath!\ServiceCenter" /e /i /r /y
-	xcopy "!appPath!\Demo" "!targetPath!\Demo" /e /i /r /y
-	xcopy "!appPath!\Robot" "!targetPath!\Robot" /e /i /r /y
-
-	::(x.x.2)copy ReleaseFile
-	xcopy  "%basePath%\Publish\ReleaseFile\StressTest\分布式压测" "!targetPath!" /e /i /r /y
-)
-
-
-
- 
-
-
-echo %~n0.bat success
-cd /d "%curPath%"
-
-
-

+ 22 - 0
Publish/DevOps3/environment/README.md

@@ -0,0 +1,22 @@
+
+# DevOps 3.5
+
+
+# build-bash
+extra steps for build, all sh files are optional (remove if not need).
+
+
+# jenkins_NoNeedApprovalForBuild.txt
+if this file exists, will not need approval for jenkins build.
+
+
+----------------------------------------------
+# ReleaseLog
+
+-----------------------
+# 3.5
+> 2024-08-24
+
+- support tester
+
+

+ 20 - 0
Publish/DevOps3/environment/build-bash__10.Test__#1.InitEnv.sh.bak

@@ -0,0 +1,20 @@
+set -e
+
+
+#---------------------------------------------------------------------
+# args
+
+args_="
+
+export basePath=/root/temp
+
+# "
+
+
+#---------------------------------------------------------------------
+echo '#build-bash__10.Test__#1.InitEnv.sh'
+
+
+
+#---------------------------------------------------------------------
+echo '#build-bash__10.Test__#1.InitEnv.sh -> #9 init test environment success!'

+ 16 - 0
Publish/DevOps3/environment/build-bash__10.Test__#3.CleanEnv.sh.bak

@@ -0,0 +1,16 @@
+set -e
+
+
+#---------------------------------------------------------------------
+# args
+
+args_="
+
+export basePath=/root/temp
+
+# "
+
+
+#---------------------------------------------------------------------
+echo '#build-bash__10.Test_#3.CleanEnv.sh'
+

+ 21 - 0
Publish/DevOps3/environment/build-bash__40.Station-publish__#4_copyExtraReleaseFiles.sh.bak

@@ -0,0 +1,21 @@
+set -e
+
+#---------------------------------------------------------------------
+# args
+args_="
+
+export basePath=/root/temp
+export netVersion=net6.0
+export publishPath=\"$basePath/Publish/release/release/Station($netVersion)\"
+
+# "
+
+
+
+#----------------------------------------------
+echo '#build-bash__40.Station-publish__#4_copyExtraReleaseFiles.sh'
+
+
+
+
+

+ 20 - 0
Publish/DevOps3/environment/build-bash__41.extra-publish.sh.bak

@@ -0,0 +1,20 @@
+set -e
+
+
+#---------------------------------------------------------------------
+# args
+args_="
+
+export basePath=/root/temp
+export NUGET_PATH=$basePath/Publish/release/.nuget
+
+# "
+
+if [ ! $NUGET_PATH ]; then NUGET_PATH=$basePath/Publish/release/.nuget; fi
+
+
+#---------------------------------------------------------------------
+echo '#build-bash__41.extra-publish.sh'
+
+
+

+ 17 - 0
Publish/DevOps3/environment/build-bash__52.docker-extra-copy.sh.bak

@@ -0,0 +1,17 @@
+set -e
+
+
+#---------------------------------------------------------------------
+# args
+
+args_="
+
+export basePath=/root/temp
+
+# "
+
+
+#---------------------------------------------------------------------
+echo '#build-bash__52.docker-extra-copy.sh'
+
+

+ 2 - 0
Publish/DevOps3/environment/jenkins_NoNeedApprovalForBuild.txt

@@ -0,0 +1,2 @@
+# jenkins_NoNeedApprovalForBuild.txt
+if this file exists, will not need approval for jenkins build.

+ 0 - 13
Publish/DevOps3/environment/readme.md

@@ -1,13 +0,0 @@
-
-# DevOps 3.3
-> 2024-06-18
-
-# build-bash
-extra steps when building, all sh files could be remove if not needed.
-
-
-
-
-
-
-

+ 4 - 0
Publish/DevOps3/github-bash/startup.bash

@@ -36,6 +36,10 @@ if [ ! $APPNAME ]; then
 	echo "APPNAME: [${APPNAME}]" 
 fi
 
+#---------------------------------------------- 
+echo '#0 run test'
+cd "$devOpsPath/build-bash"; bash 10.Test.bash;
+
 #---------------------------------------------- 
 echo '#1 build'
 cd "$devOpsPath/build-bash"; bash startup.bash;

+ 30 - 29
Publish/DevOps3/jenkins-bash/CICD.ki.git_Multibranch.deploy.jenkinsfile

@@ -42,6 +42,7 @@ pipeline {
     }
 
     stages {
+
         stage('#1 deploy ?') {
             steps {
                 timeout(time:600,unit:'SECONDS') {
@@ -56,17 +57,24 @@ pipeline {
                         echo "-------- DOCKER_ImagePrefix: [$DOCKER_ImagePrefix]"
                         echo "-------- codePath: [$codePath]"
 
-                        env.inputChoice = "no"
-                        env.inputChoice = input message: "deploy ?", 
-                            ok: 'Proceed?', 
-                            parameters: [choice(choices:["yes","no"], description: 'if not please select no', name: 'choice')]
+                        if ( fileExists("Publish/DevOps3/environment/jenkins_NoNeedApprovalForBuild.txt") ) {
+                            echo "-------- do not need approval for build"
+	                        env.ApprovalForBuild = "yes"
+                        } else {
+                            echo "-------- waiting approval for build"
+	                        env.ApprovalForBuild = "no"
+	                        env.ApprovalForBuild = input message: "deploy ?", 
+		                        ok: 'Proceed?', 
+		                        parameters: [choice(choices:["yes","no"], description: 'if not please select no', name: 'choice')]
+                        }
+
                     }
                 }
             }
         }
 
         stage('#2 change version') {
-            when { expression { env.inputChoice == "yes" } }
+            when { expression { env.ApprovalForBuild == "yes" } }
             steps {
                 script {
                     echo "#2.1 change-app-version"
@@ -79,8 +87,17 @@ pipeline {
             }
         }
 
+        stage('#3.0 build - run test') {
+            when { expression { env.ApprovalForBuild == "yes" } }
+            steps {
+                script {
+                    sshCommand remote: remote, command:  "sh -c 'set -e; export APPNAME=$APPNAME; export NUGET_PATH=$NUGET_PATH;    cd $codePath/Publish/DevOps3/build-bash; sh 10.Test.bash;  '"
+                }
+            }
+        }
+
         stage('#3.1 build - single platflorm') {
-            when { expression { env.inputChoice == "yes" } }
+            when { expression { env.ApprovalForBuild == "yes" } }
             steps {
                 script {
                     sshCommand remote: remote, command:  "sh -c 'set -e; export APPNAME=$APPNAME; export NUGET_PATH=$NUGET_PATH;    cd $codePath/Publish/DevOps3/build-bash; sh startup.bash;  '"
@@ -89,7 +106,7 @@ pipeline {
         }
 
         stage('#3.2 build - cross platform') {
-            when { expression { env.inputChoice == "yes" && env.build_crossPlatform == "yes" } }
+            when { expression { env.ApprovalForBuild == "yes" && env.build_crossPlatform == "yes" } }
             steps {
                 script {
                     sshCommand remote: remote, command:  "sh -c 'set -e; export APPNAME=$APPNAME; export NUGET_PATH=$NUGET_PATH;    cd $codePath/Publish/DevOps3/build-bash; sh 40.Station-publish-multiple.bash;  '"
@@ -98,7 +115,7 @@ pipeline {
         }
 
         stage('#4 publish') {
-            when { expression { env.inputChoice == "yes" } }
+            when { expression { env.ApprovalForBuild == "yes" } }
             steps {
                 script {
                     sshCommand remote: remote, command:  "sh -c 'set -e; export APPNAME=$APPNAME;export NUGET_PATH=$NUGET_PATH;    export NUGET_SERVER=$NUGET_SERVER;export NUGET_KEY=$NUGET_KEY;  export DOCKER_Buildx=${env.DOCKER_Buildx};export DOCKER_ImagePrefix=${env.DOCKER_ImagePrefix};export DOCKER_USERNAME=${env.DOCKER_USERNAME};export DOCKER_PASSWORD=${env.DOCKER_PASSWORD};export DOCKER_BuildxExtArgs=\"--output=type=registry,registry.insecure=true\";    cd $codePath/Publish/DevOps3/release-bash; sh startup.bash;  '"
@@ -107,7 +124,7 @@ pipeline {
         }
 
         stage('#5 save releaseFiles') {
-            when { expression { env.inputChoice == "yes" && env.WebDav_BaseUrl != "  " } }
+            when { expression { env.ApprovalForBuild == "yes" && env.WebDav_BaseUrl != "  " } }
             steps {
                 script {
                     sshCommand remote: remote, command:  "sh -c 'set -e; export basePath=\"$codePath\"; export APPNAME=$APPNAME; export appVersion=\"$appVersion\";   export WebDav_BaseUrl=\"$WebDav_BaseUrl\"; export WebDav_User=\"$WebDav_User\";    cd $codePath/Publish/DevOps3/release-bash; sh 78.push-releaseFiles-to-webdav.bash;  '"
@@ -115,36 +132,20 @@ pipeline {
             }
         }
 
-        stage('#6 deploy') {
-            when { expression { env.inputChoice == "yes" && env.build_deploy == "yes" } }
-            steps {
-                script {
-
-                    remote.name = "k8s-ssh"
-                    remote.host = "k8s.lith.cloud"
-
-                    remote.user = "${k8s_ssh_account_USR}"
-                    remote.password = "${k8s_ssh_account_PSW}"
-
-                    sshCommand remote: remote, command:  "sh -c 'set -e;  cd /home/DataStore/Local/Data/2000/200.flowtea-prod/helm;    helm upgrade flowtea --set appNum=200 --set debug=true --set resources.limits=false --set image.host=\"\" --set image.tag=\"${env.appVersion}\" --set storageClass.ssd=nfs-prod-ssd --set storageClass.hdd=nfs-prod-hdd ./flowtea -n flowtea;  '"
-                }
-            }
-        }
-
     }
 
     post {
         always {
-            timeout(time:3600,unit:'SECONDS') {
+            timeout(time:600,unit:'SECONDS') {
                 script {
-                    env.inputChoice = "yes"
-                    env.inputChoice = input message: "Clean temp files, \n will wait for 3600 seconds. \n click abort to skip clean.", 
+                    env.CleanFiles = "yes"
+                    env.CleanFiles = input message: "Clean temp files, \n will wait for 3600 seconds. \n click abort to skip clean.", 
                             ok: 'Proceed', 
                             parameters: [choice(choices:["yes","no"], name: 'choice')]
                }
             }
             script {
-                if ( inputChoice == "yes" ) {
+                if ( CleanFiles == "yes" ) {
                     echo "clean up workspace directory"
                     cleanWs()
 

+ 8 - 8
README.md

@@ -4,15 +4,15 @@ Vit.Linq provides two tools for handling Expressions: Filter and ExpressionTree.
 - **Filter** can convert between FilterRule and Expression Predicate, allowing for dynamic filtering of result sets using JSON data.    
 - **ExpressionTree** facilitates the conversion between ExpressionNode and Expression, enabling transformations between data and code.    
   > Note: Since non-primitive types cannot be transmitted via data formats, the conversion may not be fully equivalent, and some type information might be lost.    
-> source address: [https://github.com/VitormLib/Vit.Linq](https://github.com/VitormLib/Vit.Linq "https://github.com/VitormLib/Vit.Linq")    
+> source address: [https://github.com/Vit-Orm/Vit.Linq](https://github.com/Vit-Orm/Vit.Linq "https://github.com/Vit-Orm/Vit.Linq")    
 
-![](https://img.shields.io/github/license/VitormLib/Vit.Linq.svg)  
-![](https://img.shields.io/github/repo-size/VitormLib/Vit.Linq.svg)  ![](https://img.shields.io/github/last-commit/VitormLib/Vit.Linq.svg)  
+![](https://img.shields.io/github/license/Vit-Orm/Vit.Linq.svg)  
+![](https://img.shields.io/github/repo-size/Vit-Orm/Vit.Linq.svg)  ![](https://img.shields.io/github/last-commit/Vit-Orm/Vit.Linq.svg)  
  
 
 | Build | NuGet |
 | -------- | -------- |
-|![](https://github.com/VitormLib/Vit.Linq/workflows/ki_devops3/badge.svg) | [![](https://img.shields.io/nuget/v/Vit.Linq.svg)](https://www.nuget.org/packages/Vit.Linq) ![](https://img.shields.io/nuget/dt/Vit.Linq.svg) |
+|![](https://github.com/Vit-Orm/Vit.Linq/workflows/ki_devops3/badge.svg) | [![](https://img.shields.io/nuget/v/Vit.Linq.svg)](https://www.nuget.org/packages/Vit.Linq) ![](https://img.shields.io/nuget/dt/Vit.Linq.svg) |
 
 
 
@@ -40,7 +40,7 @@ dotnet add package Vit.Core
 ```
 
 Create console project and edit Program.cs
-> code address: [Program.cs](https://github.com/VitormLib/Vit.Linq/tree/master/test/Vit.Linq.Console/Program.cs)    
+> code address: [Program.cs](https://github.com/Vit-Orm/Vit.Linq/tree/master/test/Vit.Linq.Console/Program.cs)    
 ``` csharp
 using Vit.Core.Module.Serialization;
 using Vit.Linq;
@@ -110,7 +110,7 @@ dotnet add package Vit.Core
 ```
 
 Create console project and edit Program.cs
-> code address: [Program.cs](https://github.com/VitormLib/Vit.Linq/tree/master/test/Vit.Linq.Console/Program2.cs)    
+> code address: [Program.cs](https://github.com/Vit-Orm/Vit.Linq/tree/master/test/Vit.Linq.Console/Program2.cs)    
 ``` csharp
 using Vit.Core.Module.Serialization;
 using Vit.Linq;
@@ -175,8 +175,8 @@ namespace App
 
 
 Examples:  
-- [FilterRules](https://github.com/VitormLib/Vit.Linq/tree/master/test/Vit.Linq.MsTest/FilterRules/Filter_TestBase.cs)    
-- [ExpressionNodes](https://github.com/VitormLib/Vit.Linq/tree/master/test/Vit.Linq.ExpressionNodes.MsTest)    
+- [FilterRules](https://github.com/Vit-Orm/Vit.Linq/tree/master/test/Vit.Linq.MsTest/FilterRules/Filter_TestBase.cs)    
+- [ExpressionNodes](https://github.com/Vit-Orm/Vit.Linq/tree/master/test/Vit.Linq.ExpressionNodes.MsTest)    
 
 
 

+ 0 - 7
Vit.Linq.sln

@@ -9,8 +9,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vit.Linq.MsTest", "test\Vit
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vit.Linq", "src\Vit.Linq\Vit.Linq.csproj", "{A27EF8DC-2284-43BF-98E7-CE3C35E296CD}"
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vit.Linq.MsTest31", "test\Vit.Linq.MsTest31\Vit.Linq.MsTest31.csproj", "{7E513E2C-BF52-4662-AD8F-5910F283178D}"
-EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{75C25D0B-8529-4E3F-AF43-6EC1E9E40828}"
 	ProjectSection(SolutionItems) = preProject
 		doc\Example.Join.md = doc\Example.Join.md
@@ -39,10 +37,6 @@ Global
 		{A27EF8DC-2284-43BF-98E7-CE3C35E296CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{A27EF8DC-2284-43BF-98E7-CE3C35E296CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{A27EF8DC-2284-43BF-98E7-CE3C35E296CD}.Release|Any CPU.Build.0 = Release|Any CPU
-		{7E513E2C-BF52-4662-AD8F-5910F283178D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{7E513E2C-BF52-4662-AD8F-5910F283178D}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{7E513E2C-BF52-4662-AD8F-5910F283178D}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{7E513E2C-BF52-4662-AD8F-5910F283178D}.Release|Any CPU.Build.0 = Release|Any CPU
 		{32F107EF-09D7-4D5D-9D43-6BA00DAEBD5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{32F107EF-09D7-4D5D-9D43-6BA00DAEBD5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{32F107EF-09D7-4D5D-9D43-6BA00DAEBD5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -57,7 +51,6 @@ Global
 	EndGlobalSection
 	GlobalSection(NestedProjects) = preSolution
 		{5801E323-C03D-48D2-BEFF-DE060B3293B0} = {0062F400-558C-4084-8004-3C8D4CBBFDE4}
-		{7E513E2C-BF52-4662-AD8F-5910F283178D} = {0062F400-558C-4084-8004-3C8D4CBBFDE4}
 		{32F107EF-09D7-4D5D-9D43-6BA00DAEBD5C} = {0062F400-558C-4084-8004-3C8D4CBBFDE4}
 		{FC2D5B01-792D-4CDC-BB78-9379D4DB5441} = {0062F400-558C-4084-8004-3C8D4CBBFDE4}
 	EndGlobalSection

+ 8 - 8
doc/README_CN.md

@@ -4,15 +4,15 @@ Vit.Linq 提供两个针对Expression表达式的工具,Filter 和 ExpressionT
  _ **Filter** 可以把 FilterRule 和 Expression Predicate 进行相互转换, 由此可以通过 json 数据 对结果集进行动态化筛选。    
  - **ExpressionTree** 实现 ExpressionNode 和 Expression 表达式的相互转换实现数据和代码的转换。    
   > 因为非基本类型Type不能通过数据格式进行传递,所以转换并不是完全百分百互等的,会丢失部分类型信息    
-> source address: [https://github.com/VitormLib/Vit.Linq](https://github.com/VitormLib/Vit.Linq "https://github.com/VitormLib/Vit.Linq")    
+> source address: [https://github.com/Vit-Orm/Vit.Linq](https://github.com/Vit-Orm/Vit.Linq "https://github.com/Vit-Orm/Vit.Linq")    
 
-![](https://img.shields.io/github/license/VitormLib/Vit.Linq.svg)  
-![](https://img.shields.io/github/repo-size/VitormLib/Vit.Linq.svg)  ![](https://img.shields.io/github/last-commit/VitormLib/Vit.Linq.svg)  
+![](https://img.shields.io/github/license/Vit-Orm/Vit.Linq.svg)  
+![](https://img.shields.io/github/repo-size/Vit-Orm/Vit.Linq.svg)  ![](https://img.shields.io/github/last-commit/Vit-Orm/Vit.Linq.svg)  
  
 
 | Build | NuGet |
 | -------- | -------- |
-|![](https://github.com/VitormLib/Vit.Linq/workflows/ki_devops3/badge.svg) | [![](https://img.shields.io/nuget/v/Vit.Linq.svg)](https://www.nuget.org/packages/Vit.Linq) ![](https://img.shields.io/nuget/dt/Vit.Linq.svg) |
+|![](https://github.com/Vit-Orm/Vit.Linq/workflows/ki_devops3/badge.svg) | [![](https://img.shields.io/nuget/v/Vit.Linq.svg)](https://www.nuget.org/packages/Vit.Linq) ![](https://img.shields.io/nuget/dt/Vit.Linq.svg) |
 
 
 
@@ -38,7 +38,7 @@ dotnet add package Vit.Core
 ```
 
 创建 console project 并按如下修改 Program.cs
-> code address: [Program.cs](https://github.com/VitormLib/Vit.Linq/tree/master/test/Vit.Linq.Console/Program.cs)    
+> code address: [Program.cs](https://github.com/Vit-Orm/Vit.Linq/tree/master/test/Vit.Linq.Console/Program.cs)    
 ``` csharp
 using Vit.Core.Module.Serialization;
 using Vit.Linq.Filter.ComponentModel;
@@ -106,7 +106,7 @@ dotnet add package Vit.Core
 ```
 
 创建 console project 并按如下修改 Program2.cs
-> code address: [Program2.cs](https://github.com/VitormLib/Vit.Linq/tree/master/test/Vit.Linq.Console/Program2.cs)    
+> code address: [Program2.cs](https://github.com/Vit-Orm/Vit.Linq/tree/master/test/Vit.Linq.Console/Program2.cs)    
 ``` csharp
 using Vit.Core.Module.Serialization;
 using Vit.Linq;
@@ -163,8 +163,8 @@ namespace App
 
  
 Examples:  
-- [FilterRules](https://github.com/VitormLib/Vit.Linq/tree/master/test/Vit.Linq.MsTest/FilterRules/Filter_TestBase.cs)    
-- [ExpressionNodes](https://github.com/VitormLib/Vit.Linq/tree/master/test/Vit.Linq.ExpressionNodes.MsTest)    
+- [FilterRules](https://github.com/Vit-Orm/Vit.Linq/tree/master/test/Vit.Linq.MsTest/FilterRules/Filter_TestBase.cs)    
+- [ExpressionNodes](https://github.com/Vit-Orm/Vit.Linq/tree/master/test/Vit.Linq.ExpressionNodes.MsTest)    
 
 
 

+ 16 - 0
src/Vit.Linq/ExpressionNodes/ComponentModel/ExpressionNode/ExpressionNode_Lambda.cs

@@ -1,4 +1,5 @@
 using System;
+using System.Linq.Expressions;
 
 
 
@@ -14,6 +15,9 @@ namespace Vit.Linq.ExpressionNodes.ComponentModel
         Type[] Lambda_GetParamTypes();
         Type Lambda_GetReturnType();
         ExpressionNode Lambda_SetParamTypes(Type[] paramTypes, Type returnType = null);
+
+        LambdaExpression Lambda_GetLambdaExpression();
+        ExpressionNode Lambda_SetLambdaExpression(LambdaExpression lambda);
     }
 
     public partial class ExpressionNode : ExpressionNode_Lambda
@@ -50,5 +54,17 @@ namespace Vit.Linq.ExpressionNodes.ComponentModel
         }
 
 
+        public LambdaExpression Lambda_GetLambdaExpression()
+        {
+            return GetCodeArg("Lambda_LambdaExpression") as LambdaExpression;
+        }
+        public ExpressionNode Lambda_SetLambdaExpression(LambdaExpression lambda)
+        {
+            if (lambda != null)
+                SetCodeArg("Lambda_LambdaExpression", lambda);
+            return this;
+        }
+
+
     }
 }

+ 1 - 1
src/Vit.Linq/ExpressionNodes/ExpressionConvertor/Lambda.cs

@@ -21,7 +21,7 @@ namespace Vit.Linq.ExpressionNodes.ExpressionConvertor
 
                 var parameterTypes = lambda.Parameters.Select(parameter => parameter.Type).ToArray();
                 var returnType = lambda.ReturnType;
-                return ExpressionNode.Lambda(parameterNames: parameterNames, body: body).Lambda_SetParamTypes(parameterTypes, returnType);
+                return ExpressionNode.Lambda(parameterNames: parameterNames, body: body).Lambda_SetParamTypes(parameterTypes, returnType).Lambda_SetLambdaExpression(lambda);
             }
 
             return null;

+ 5 - 3
src/Vit.Linq/QueryableBuilder.cs

@@ -21,6 +21,10 @@ namespace Vit.Linq
             return (query as IQueryWithConfig)?.queryConfig;
         }
 
+        public static bool BuildFrom(IQueryable query)
+        {
+            return query is IQueryWithConfig;
+        }
 
         public static Func<object, Type, bool> CompareQueryByName(string queryName)
         {
@@ -72,11 +76,9 @@ namespace Vit.Linq
 
             return null;
         }
-    }
 
 
-    public static partial class QueryableBuilder
-    {
+
         interface IQueryWithConfig
         {
             object queryConfig { get; }

+ 2 - 2
src/Vit.Linq/Vit.Linq.csproj

@@ -6,14 +6,14 @@
 
     <PropertyGroup>
         <TargetFramework>netstandard2.0</TargetFramework>
-        <Version>3.1.0</Version>
+        <Version>3.1.1</Version>
         <LangVersion>9.0</LangVersion>
     </PropertyGroup>
 
     <PropertyGroup>
         <Authors>Lith</Authors>
         <Description>Linq Extension</Description>
-        <PackageProjectUrl>https://github.com/VitormLib/Vit.Linq</PackageProjectUrl>
+        <PackageProjectUrl>https://github.com/Vit-Orm/Vit.Linq</PackageProjectUrl>
         <PackageReadmeFile>README.md</PackageReadmeFile>
         <PackageTags>linq</PackageTags>
     </PropertyGroup>

+ 7 - 3
test/Vit.Linq.ExpressionNodes.MsTest/Vit.Linq.ExpressionNodes.MsTest.csproj

@@ -1,5 +1,9 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
+    <PropertyGroup>
+        <test>MSTest</test>
+    </PropertyGroup>
+
     <PropertyGroup>
         <TargetFramework>net6.0</TargetFramework>
         <ImplicitUsings>enable</ImplicitUsings>
@@ -8,9 +12,9 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
-        <PackageReference Include="MSTest.TestAdapter" Version="3.5.1" />
-        <PackageReference Include="MSTest.TestFramework" Version="3.5.1" />
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
+        <PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
+        <PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
 
         <PackageReference Include="Vit.Core" Version="2.2.0" />
         <PackageReference Include="Sers.Core" Version="2.1.27" />

+ 7 - 3
test/Vit.Linq.MsTest/Vit.Linq.MsTest.csproj

@@ -1,5 +1,9 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
+    <PropertyGroup>
+        <test>MSTest</test>
+    </PropertyGroup>
+
     <PropertyGroup>
         <TargetFramework>net6.0</TargetFramework>
         <IsPackable>false</IsPackable>
@@ -7,9 +11,9 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
-        <PackageReference Include="MSTest.TestAdapter" Version="3.5.1" />
-        <PackageReference Include="MSTest.TestFramework" Version="3.5.1" />
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
+        <PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
+        <PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
 
         <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
         <PackageReference Include="System.Text.Json" Version="8.0.4" />

+ 0 - 30
test/Vit.Linq.MsTest31/Vit.Linq.MsTest31.csproj

@@ -1,30 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-    <PropertyGroup>
-        <TargetFramework>netcoreapp3.1</TargetFramework>
-        <IsPackable>false</IsPackable>
-    </PropertyGroup>
-
-    <ItemGroup>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
-        <PackageReference Include="MSTest.TestAdapter" Version="3.5.1" />
-        <PackageReference Include="MSTest.TestFramework" Version="3.5.1" />
-        <PackageReference Include="Vit.Core" Version="2.2.0" />
-
-        <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
-        <PackageReference Include="System.Text.Json" Version="8.0.4" />
-    </ItemGroup>
-
-    <ItemGroup>
-        <ProjectReference Include="..\..\src\Vit.Linq\Vit.Linq.csproj" />
-    </ItemGroup>
-
-    <ItemGroup>
-        <Compile Include="..\Vit.Linq.MsTest\Extensions\*.cs" Link="Extensions\%(RecursiveDir)%(FileName)%(Extension)" />
-        <Compile Include="..\Vit.Linq.MsTest\FilterRules\**\*.cs" Link="FilterRules\%(RecursiveDir)%(FileName)%(Extension)" />
-        <Compile Include="..\Vit.Linq.MsTest\DataSource.cs" />
-        <Compile Include="..\Vit.Linq.MsTest\QueryableBuilder_Test.cs" />
-    </ItemGroup>
-
-
-</Project>