Explorar el Código

Merge pull request #8 from LithWang/release/2.1.2

Release/2.1.2
Lith hace 8 meses
padre
commit
8debcfc155
Se han modificado 33 ficheros con 383 adiciones y 475 borrados
  1. 36 12
      .github/workflows/ki_devops3_build.yml
  2. 45 0
      .github/workflows/ki_devops3_test.yml
  3. 2 1
      Publish/DevOps3/build-bash/19.get-app-version.bash
  4. 2 1
      Publish/DevOps3/build-bash/20.change-app-version.bash
  5. 2 1
      Publish/DevOps3/build-bash/21.change-to-next-version.bash
  6. 2 1
      Publish/DevOps3/build-bash/22.add-suffix-to-app-version.bash
  7. 0 57
      Publish/DevOps3/build-cmd/40.Station-publish.bat
  8. 0 36
      Publish/DevOps3/build-cmd/50.docker-image-create.bat
  9. 0 36
      Publish/DevOps3/build-cmd/51.docker-deploy-copy.bat
  10. 0 21
      Publish/DevOps3/build-cmd/OneKey Release.bat
  11. 0 46
      Publish/DevOps3/build-cmd/Version-To-NextTemp.bat
  12. 0 46
      Publish/DevOps3/build-cmd/Version-To-Preview.bat
  13. 0 43
      Publish/DevOps3/build-cmd/Version-To-Release.bat
  14. 0 32
      Publish/DevOps3/build-cmd/Version-getVersion.bat
  15. 9 1
      Publish/DevOps3/environment/README.md
  16. 0 3
      Publish/DevOps3/github-bash/startup.bash
  17. 1 1
      README.md
  18. 3 0
      Vitorm.sln
  19. 5 0
      doc/ReleaseLog.md
  20. 6 0
      src/Versions.props
  21. 202 0
      src/Vitorm.Data/Data.DataSource.cs
  22. 55 124
      src/Vitorm.Data/Data.cs
  23. 1 1
      src/Vitorm.Data/README.md
  24. 1 1
      src/Vitorm.Data/Vitorm.Data.csproj
  25. 1 1
      src/Vitorm.EntityGenerate/README.md
  26. 1 1
      src/Vitorm.EntityGenerate/Vitorm.EntityGenerate.csproj
  27. 1 1
      src/Vitorm.MySql/README.md
  28. 1 1
      src/Vitorm.MySql/Vitorm.MySql.csproj
  29. 1 1
      src/Vitorm.SqlServer/README.md
  30. 1 1
      src/Vitorm.SqlServer/Vitorm.SqlServer.csproj
  31. 1 1
      src/Vitorm.Sqlite/README.md
  32. 1 1
      src/Vitorm.Sqlite/Vitorm.Sqlite.csproj
  33. 3 3
      src/Vitorm/Vitorm.csproj

+ 36 - 12
.github/workflows/ki_devops3.yml → .github/workflows/ki_devops3_build.yml

@@ -1,14 +1,13 @@
 # This is a basic workflow to help you get started with Actions
 
-name: ki_devops3
+name: ki_devops3_build
 
 # Controls when the action will run. 
 on:
   
-  push:
+  #push:
     # Triggers the workflow on push events for the branches start with release
-    branches:
-      - 'release/**'
+    #branches:: [ 'release/**' ]
 
     # Triggers the workflow on push events but only for the master branch
     #branches: [ master ]
@@ -18,24 +17,49 @@ on:
     
   # Allows you to run this workflow manually from the Actions tab
   workflow_dispatch:
+  merge_group:
 
 # A workflow run is made up of one or more jobs that can run sequentially or in parallel
 jobs:
-  # This workflow contains a single job called "build"
-  build:
+
+  # This workflow contains a single job called "devops3_test"
+  devops3_test:
     # The type of runner that the job will run on
     runs-on: ubuntu-latest
 
     # Steps represent a sequence of tasks that will be executed as part of the job
     steps:
       # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
 
       # Runs a set of commands using the runners shell
-      - name: Run startup.bash
+      - name: Run test
         run: |
            set -e
-           echo start build
+           echo call ./Publish/DevOps3/build-bash/10.Test.bash to test
+
+           cd ./Publish/DevOps3/build-bash
+           bash 10.Test.bash;
+           echo run test succeed!
+
+  # This workflow contains a single job called "devops3_build"
+  devops3_build:
+    # Requiring successful dependent jobs
+    needs: devops3_test
+
+    # The type of runner that the job will run on
+    runs-on: ubuntu-latest
+
+    # Steps represent a sequence of tasks that will be executed as part of the job
+    steps:
+      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+      - uses: actions/checkout@v4
+
+      # Runs a set of commands using the runners shell
+      - name: Run build
+        run: |
+           set -e
+           echo call ./Publish/DevOps3/github-bash/startup.bash to build
 
            export DOCKER_ImagePrefix="serset/"
            export DOCKER_USERNAME="${{ secrets.DOCKER_USERNAME  }}"
@@ -47,10 +71,10 @@ jobs:
            cd ./Publish/DevOps3/github-bash
            bash startup.bash
            echo build succeed!
-           
+
            # echo "appName=${APPNAME}" >> $GITHUB_ENV
-           
-           
+
+
       - name: release_create
         id: release_create
         uses: actions/create-release@v1

+ 45 - 0
.github/workflows/ki_devops3_test.yml

@@ -0,0 +1,45 @@
+# This is a basic workflow to help you get started with Actions
+
+name: ki_devops3_test
+
+# Controls when the action will run. 
+on:
+  
+  #push:
+    # Triggers the workflow on push events for the branches start with release
+    #branches:: [ 'release/**' ]
+
+    # Triggers the workflow on push events but only for the master branch
+    #branches: [ master ]
+
+    # Triggers the workflow on push tag
+    #tags: ['*']
+    
+  # Allows you to run this workflow manually from the Actions tab
+  workflow_dispatch:
+
+  pull_request:
+    types: [opened, synchronize, reopened]
+  merge_group:
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+  # This workflow contains a single job called "devops3_test"
+  devops3_test:
+    # The type of runner that the job will run on
+    runs-on: ubuntu-latest
+
+    # Steps represent a sequence of tasks that will be executed as part of the job
+    steps:
+      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+      - uses: actions/checkout@v4
+
+      # Runs a set of commands using the runners shell
+      - name: Run test
+        run: |
+           set -e
+           echo call ./Publish/DevOps3/build-bash/10.Test.bash to test
+
+           cd ./Publish/DevOps3/build-bash
+           bash 10.Test.bash;
+           echo run test succeed!

+ 2 - 1
Publish/DevOps3/build-bash/19.get-app-version.bash

@@ -24,7 +24,8 @@ if [ -z "$basePath" ]; then basePath=$PWD/../../..; fi
 #----------------------------------------------
 echo "#1 get appVersion"
 # get csproj file with appVersion tag, if not exist get file with pack or publish tag
-csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);
+csprojPath=$(find ${basePath} -name *.props -exec grep '<Version>' -l {} \; | head -n 1);
+if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);  fi
 if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<pack>\|<publish>' -l {} \; | head -n 1);  fi
 if [ -f "$csprojPath" ]; then export appVersion=`grep '<Version>' "$csprojPath" | grep -oE '\>(.*)\<' | tr -d '<>/'`;  fi
 echo "appVersion from csproj: $appVersion"

+ 2 - 1
Publish/DevOps3/build-bash/20.change-app-version.bash

@@ -24,7 +24,8 @@ if [ -z "$basePath" ]; then basePath=$PWD/../../..; fi
 #----------------------------------------------
 echo "#1 get appVersion"
 # get csproj file with appVersion tag, if not exist get file with pack or publish tag
-csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);
+csprojPath=$(find ${basePath} -name *.props -exec grep '<Version>' -l {} \; | head -n 1);
+if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);  fi
 if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<pack>\|<publish>' -l {} \; | head -n 1);  fi
 if [ -f "$csprojPath" ]; then export appVersion=`grep '<Version>' "$csprojPath" | grep -oE '\>(.*)\<' | tr -d '<>/'`;  fi
 echo "appVersion from csproj: $appVersion"

+ 2 - 1
Publish/DevOps3/build-bash/21.change-to-next-version.bash

@@ -24,7 +24,8 @@ if [ -z "$basePath" ]; then basePath=$PWD/../../..; fi
 #----------------------------------------------
 echo "#1 get appVersion"
 # get csproj file with appVersion tag, if not exist get file with pack or publish tag
-csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);
+csprojPath=$(find ${basePath} -name *.props -exec grep '<Version>' -l {} \; | head -n 1);
+if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);  fi
 if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<pack>\|<publish>' -l {} \; | head -n 1);  fi
 if [ -f "$csprojPath" ]; then export appVersion=`grep '<Version>' "$csprojPath" | grep -oE '\>(.*)\<' | tr -d '<>/'`;  fi
 echo "appVersion from csproj: $appVersion"

+ 2 - 1
Publish/DevOps3/build-bash/22.add-suffix-to-app-version.bash

@@ -24,7 +24,8 @@ if [ -z "$basePath" ]; then basePath=$PWD/../../..; fi
 #----------------------------------------------
 echo "#1 get appVersion"
 # get csproj file with appVersion tag, if not exist get file with pack or publish tag
-csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);
+csprojPath=$(find ${basePath} -name *.props -exec grep '<Version>' -l {} \; | head -n 1);
+if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<appVersion>' -l {} \; | head -n 1);  fi
 if [ ! -f "$csprojPath" ]; then csprojPath=$(find ${basePath} -name *.csproj -exec grep '<pack>\|<publish>' -l {} \; | head -n 1);  fi
 if [ -f "$csprojPath" ]; then export appVersion=`grep '<Version>' "$csprojPath" | grep -oE '\>(.*)\<' | tr -d '<>/'`;  fi
 echo "appVersion from csproj: $appVersion"

+ 0 - 57
Publish/DevOps3/build-cmd/40.Station-publish.bat

@@ -1,57 +0,0 @@
-@echo off
-
-::enable delayed arguments
-setlocal EnableDelayedExpansion
-
-
-:: #1 get basePath
-set curPath=%cd%
-cd /d "%~dp0"
-cd /d ../../..
-set basePath=%cd%
-
-
-:: #2 get netVersion
-set netVersion=net6.0
-for /f "tokens=3 delims=><" %%a in ('type %basePath%\dotnet\ServiceCenter\App.ServiceCenter\App.ServiceCenter.csproj^|findstr "<TargetFramework>.*TargetFramework"') do set netVersion=%%a
-
-
-set publishPath=%basePath%/Publish/release/release/Station(%netVersion%)
-echo publish Station
-echo dotnet version: %netVersion%
-
-
-
-:: #3 find projects and publish
-for /f "delims=" %%f in ('findstr /M /s /i "<publish>" *.csproj') do (
-	::get name
-	for /f "tokens=3 delims=><" %%a in ('type "%basePath%\%%f"^|findstr "<publish>.*publish"') do set name=%%a
-	echo publish !name!
-
-	::publish
-	cd /d "%basePath%\%%f\.."
-	dotnet build --configuration Release
-	dotnet publish --configuration Release --output "%publishPath%\!name!"
-	@if errorlevel 1 (echo . & echo .  & echo error & pause) 
-
-	::copy xml
-	xcopy  "bin\Release\%netVersion%\*.xml" "%publishPath%\!name!" /i /r /y
-)
-
-
-
-:: #4 copy dir
-xcopy "%basePath%\Publish\ReleaseFile\Station" "%publishPath%" /e /i /r /y
-
-
-
-:: #5 copy ServiceCenter
-xcopy "%publishPath%\ServiceCenter" "%basePath%\Publish\release\release\ServiceCenter(%netVersion%)\ServiceCenter" /e /i /r /y
-xcopy "%publishPath%\01.ServiceCenter.bat" "%basePath%\Publish\release\release\ServiceCenter(%netVersion%)"
-xcopy "%publishPath%\01.Start-4580.bat" "%basePath%\Publish\release\release\ServiceCenter(%netVersion%)"
-
-
-
-
-echo %~n0.bat success
-cd /d "%curPath%"

+ 0 - 36
Publish/DevOps3/build-cmd/50.docker-image-create.bat

@@ -1,36 +0,0 @@
-@echo off
-
-
-echo %~n0.bat start...
-
-
-:: #1 get basePath
-set curPath=%cd%
-cd /d "%~dp0"
-cd /d ../../..
-set basePath=%cd%
-
-:: #2
-set publishPath=%basePath%/Publish/release/release/Station(net6.0)
-set dockerPath=%basePath%/Publish/release/release/docker-image
-rd /s /q "%dockerPath%"
-
-
-:: #3 copy dir
-xcopy "%basePath%/Publish/ReleaseFile/docker-image" "%dockerPath%" /e /i /r /y
-
-
-:: #4 copy station 
-xcopy  "%publishPath%/ServiceCenter" "%dockerPath%/sers/app" /e /i /r /y
-xcopy  "%publishPath%/Gateway" "%dockerPath%/sers-gateway/app" /e /i /r /y
-xcopy  "%publishPath%/Gover" "%dockerPath%/sers-gover/app" /e /i /r /y
-xcopy  "%publishPath%/Demo" "%dockerPath%/sers-demo/app" /e /i /r /y
-xcopy  "%publishPath%/Robot" "%dockerPath%/sers-demo-robot/app" /e /i /r /y
-xcopy  "%basePath%/Publish/release/release/压测/单体压测net6.0/ServiceCenter" "%dockerPath%/sers-demo-sersall/app" /e /i /r /y
- 
-
-
-
-
-echo %~n0.bat success
-cd /d "%curPath%"

+ 0 - 36
Publish/DevOps3/build-cmd/51.docker-deploy-copy.bat

@@ -1,36 +0,0 @@
-@echo off
-
-
-echo %~n0.bat start...
-
-
-::#1 get basePath
-set curPath=%cd%
-cd /d "%~dp0"
-cd /d ..\..\..
-set basePath=%cd%
-
-
-:: #2
-set publishPath=%basePath%\Publish\release\release\Station(net6.0)
-set dockerPath=%basePath%\Publish\release\release\docker-deploy
-rd /s /q "%dockerPath%"
-
-
-:: #3 copy dir
-xcopy "%basePath%\Publish\ReleaseFile\docker-deploy" "%dockerPath%" /e /i /r /y
-
-
-:: #4 copy station 
-xcopy "%publishPath%\ServiceCenter\appsettings.json" "%dockerPath%\sers"
-xcopy "%publishPath%\Gateway\appsettings.json" "%dockerPath%\sers-gateway"
-xcopy "%publishPath%\Gover\appsettings.json" "%dockerPath%\sers-gover"
-xcopy "%publishPath%\Demo\appsettings.json" "%dockerPath%\sers-demo"
-xcopy "%publishPath%\Robot\appsettings.json" "%dockerPath%\sers-demo-robot"
-xcopy "%basePath%\Publish\release\release\压测\单体压测net6.0\ServiceCenter\appsettings.json" "%dockerPath%\sers-demo-sersall"
-
-
-
-
-echo %~n0.bat success
-cd /d "%curPath%"

+ 0 - 21
Publish/DevOps3/build-cmd/OneKey Release.bat

@@ -1,21 +0,0 @@
-
-echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
-call "30.nuget-pack.bat"
-
-echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
-call "40.Station-publish.bat"
-call "40.Station-publish(netcoreapp2.1).bat"
-call "40.Station-publish(net6.0).bat"
-
-call "41.StressTest-publish.bat"
-
-echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
-call "50.docker-image-create.bat"
-call "51.docker-deploy-copy.bat"
-
-echo %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
-
-
-echo %~n0.bat success
-
-pause

+ 0 - 46
Publish/DevOps3/build-cmd/Version-To-NextTemp.bat

@@ -1,46 +0,0 @@
-@echo off
-
-:: #1 get csproj
-for /f "delims=" %%a in ('findstr /M /s /i /r "<pack> <publish>" "..\..\..\*.csproj"') do set "csproj=%%~a"
-::echo %csproj%
-
-:: #2 get version
-for /f "tokens=3 delims=><" %%a in ('type %csproj%^|findstr "<Version>.*Version"') do set version=%%a
-
-:: set version=2.1.3
-:: echo  %version%
-
-
-:: #3 get v1 v2 v3
-for /f "tokens=1 delims=-" %%i in ("%version%") do set numVersion=%%i
-
-:: v1 v2 v3
-for /f "tokens=1 delims=." %%i in ("%numVersion%") do set v1=%%i
-for /f "tokens=2 delims=." %%i in ("%numVersion%") do set v2=%%i
-for /f "tokens=3 delims=." %%i in ("%numVersion%") do set v3=%%i
-
-
-:: #4 newVersion
-set /a v3=1+%v3%
-set newVersion=%v1%.%v2%.%v3%-temp
-:: echo %newVersion%
-
-
- 
-:: #5 replace version in csproj
-echo replace verion [%version%]-^>[%newVersion%]
-echo.
-
-VsTool.exe replace -r --path "..\..\.." --file "*.csproj" --old "<Version>%version%</Version>" --new "<Version>%newVersion%</Version>"
-VsTool.exe replace -r --path "..\..\.." --file "packages.config" --old "%version%" --new "%newVersion%"
-
-
-:: #6 replace version in docker image file
-VsTool.exe replace -r --path "..\..\..\Publish\ReleaseFile\docker-image" --file "*.md" --old "%version%" --new "%newVersion%"
-
-
-echo.
-echo.
-echo.
-echo replace version success [%version%]-^>[%newVersion%]
-pause

+ 0 - 46
Publish/DevOps3/build-cmd/Version-To-Preview.bat

@@ -1,46 +0,0 @@
-@echo off
-
-:: #1 get csproj
-for /f "delims=" %%a in ('findstr /M /s /i /r "<pack> <publish>" "..\..\..\*.csproj"') do set "csproj=%%~a"
-::echo %csproj%
-
-:: #2 get version
-for /f "tokens=3 delims=><" %%a in ('type %csproj%^|findstr "<Version>.*Version"') do set version=%%a
-
-:: set version=2.1.3
-:: echo  %version%
-
-
-:: #3 get v1 v2 v3
-for /f "tokens=1 delims=-" %%i in ("%version%") do set numVersion=%%i
-
-:: v1 v2 v3
-for /f "tokens=1 delims=." %%i in ("%numVersion%") do set v1=%%i
-for /f "tokens=2 delims=." %%i in ("%numVersion%") do set v2=%%i
-for /f "tokens=3 delims=." %%i in ("%numVersion%") do set v3=%%i
-
-
-:: #4 newVersion
-:: set /a v3=1+%v3%
-set newVersion=%v1%.%v2%.%v3%-preview
-:: echo %newVersion%
-
-
- 
-:: #5 replace version in csproj
-echo ×Ô¶¯Ð޸İ汾ºÅ [%version%]-^>[%newVersion%]
-echo.
-
-VsTool.exe replace -r --path "..\..\.." --file "*.csproj" --old "<Version>%version%</Version>" --new "<Version>%newVersion%</Version>"
-VsTool.exe replace -r --path "..\..\.." --file "packages.config" --old "%version%" --new "%newVersion%"
-
-
-:: #6 replace version in docker image file
-VsTool.exe replace -r --path "..\..\..\Publish\ReleaseFile\docker-image" --file "*.md" --old "%version%" --new "%newVersion%"
-
-
-echo.
-echo.
-echo.
-echo replace version success [%version%]-^>[%newVersion%]
-pause

+ 0 - 43
Publish/DevOps3/build-cmd/Version-To-Release.bat

@@ -1,43 +0,0 @@
-@echo off
-
-:: #1 get csproj
-for /f "delims=" %%a in ('findstr /M /s /i /r "<pack> <publish>" "..\..\..\*.csproj"') do set "csproj=%%~a"
-::echo %csproj%
-
-:: #2 get version
-for /f "tokens=3 delims=><" %%a in ('type %csproj%^|findstr "<Version>.*Version"') do set version=%%a
-
-:: set version=2.1.3
-:: echo  %version%
-
-
-:: #3 get v1 v2 v3
-for /f "tokens=1 delims=-" %%i in ("%version%") do set numVersion=%%i
-
-:: v1 v2 v3
-for /f "tokens=1 delims=." %%i in ("%numVersion%") do set v1=%%i
-for /f "tokens=2 delims=." %%i in ("%numVersion%") do set v2=%%i
-for /f "tokens=3 delims=." %%i in ("%numVersion%") do set v3=%%i
-
-
-:: #4 newVersion
-:: set /a v3=1+%v3%
-set newVersion=%v1%.%v2%.%v3%
-:: echo %newVersion%
-echo [%version%]-^>[%newVersion%]
-
- 
-:: #5 replace version in csproj
-VsTool.exe replace -r --path "..\..\.." --file "*.csproj" --old "<Version>%version%</Version>" --new "<Version>%newVersion%</Version>"
-VsTool.exe replace -r --path "..\..\.." --file "packages.config" --old "%version%" --new "%newVersion%"
-
-
-:: #6 replace version in docker image file
-VsTool.exe replace -r --path "..\..\..\Publish\ReleaseFile\docker-image" --file "*.md" --old "%version%" --new "%newVersion%"
-
-
-echo.
-echo.
-echo.
-echo replace version success [%version%]-^>[%newVersion%]
-pause

+ 0 - 32
Publish/DevOps3/build-cmd/Version-getVersion.bat

@@ -1,32 +0,0 @@
-@echo off
-
-:: get current version
-
-
-:: #1 get csproj
-for /f "delims=" %%a in ('findstr /M /s /i /r "<pack> <publish>" "..\..\..\*.csproj"') do set "csproj=%%~a"
-echo %csproj%
-
-:: #2 get version
-for /f "tokens=3 delims=><" %%a in ('type %csproj%^|findstr "<Version>.*Version"') do set version=%%a
-
-:: set version=2.1.3
-:: echo  %version%
-
-
-:: #3 get v1 v2 v3
-for /f "tokens=1 delims=-" %%i in ("%version%") do set numVersion=%%i
-
-:: v1 v2 v3
-for /f "tokens=1 delims=." %%i in ("%numVersion%") do set v1=%%i
-for /f "tokens=2 delims=." %%i in ("%numVersion%") do set v2=%%i
-for /f "tokens=3 delims=." %%i in ("%numVersion%") do set v3=%%i
-
-
-:: #4 newVersion
-::set /a v3=1+%v3%
-set  newVersion=%v1%.%v2%.%v3%-preview
-echo [%version%]-^>[%newVersion%]
-
-
-pause

+ 9 - 1
Publish/DevOps3/environment/README.md

@@ -1,5 +1,5 @@
 
-# DevOps 3.5
+# DevOps 3.6
 
 
 # build-bash
@@ -13,6 +13,14 @@ if this file exists, will not need approval for jenkins build.
 ----------------------------------------------
 # ReleaseLog
 
+-----------------------
+# 3.6
+> 2024-08-30
+
+- able to get release version from .props file
+- [github actions] auto trigger test workflow for PR in checks
+- [github actions] auto trigger test workflow for PR in checks
+
 -----------------------
 # 3.5
 > 2024-08-24

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

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

+ 1 - 1
README.md

@@ -12,7 +12,7 @@ This means you get the best of both worlds: the performance and simplicity of Da
 
 | Build | NuGet |
 | -------- | -------- |
-|![](https://github.com/Vit-Orm/Vitorm/workflows/ki_devops3/badge.svg) | [![](https://img.shields.io/nuget/v/Vitorm.svg)](https://www.nuget.org/packages/Vitorm) ![](https://img.shields.io/nuget/dt/Vitorm.svg) |
+|![](https://github.com/Vit-Orm/Vitorm/workflows/ki_devops3_build/badge.svg) | [![](https://img.shields.io/nuget/v/Vitorm.svg)](https://www.nuget.org/packages/Vitorm) ![](https://img.shields.io/nuget/dt/Vitorm.svg) |
 
 
 

+ 3 - 0
Vitorm.sln

@@ -16,6 +16,9 @@ EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vitorm", "src\Vitorm\Vitorm.csproj", "{FA62D5F8-F6C1-4677-B115-DC32CF9EFC50}"
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{05176905-A2A5-4015-9F04-2904506C902F}"
+	ProjectSection(SolutionItems) = preProject
+		src\Versions.props = src\Versions.props
+	EndProjectSection
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vitorm.MySql", "src\Vitorm.MySql\Vitorm.MySql.csproj", "{6ED8DCE2-FAE1-4EC3-9C2A-74F8ACCAF3CB}"
 EndProject

+ 5 - 0
doc/ReleaseLog.md

@@ -1,5 +1,10 @@
 # Vitorm ReleaseLog
 
+-----------------------
+# 2.1.2
+- [Vitorm.Data] add DataSource class, change methods to instance from static
+
+
 -----------------------
 # 2.1.0
 - block query from different data source

+ 6 - 0
src/Versions.props

@@ -0,0 +1,6 @@
+<Project>
+    <PropertyGroup>
+        <Version>2.1.2</Version>
+        <VitLinq_Version>[3.1.2, 3.2.0)</VitLinq_Version>
+    </PropertyGroup>
+</Project>

+ 202 - 0
src/Vitorm.Data/Data.DataSource.cs

@@ -0,0 +1,202 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+using Vit.Core.Util.ConfigurationManager;
+using Vit.Core.Util.Reflection;
+using Vit.Linq;
+
+using Vitorm.DataProvider;
+
+namespace Vitorm
+{
+    public partial class Data
+    {
+        public partial class DataSource
+        {
+
+            /// <summary>
+            /// Data.Init("appsettings.Development.json")
+            /// </summary>
+            /// <param name="appsettingsFileName"></param>
+            public DataSource LoadDataProviders(string appsettingsFileName)
+            {
+                LoadDataProviders(new JsonFile(appsettingsFileName));
+                return this;
+            }
+
+            public DataSource LoadDataProviders(JsonFile json, string configPath = "Vitorm.Data")
+            {
+                var dataProviderConfigs = json.GetByPath<List<Dictionary<string, object>>>(configPath);
+                return LoadDataProviders(dataProviderConfigs);
+            }
+            public DataSource LoadDataProviders(IEnumerable<Dictionary<string, object>> dataProviderConfigs)
+            {
+                var dataProviders = dataProviderConfigs?.Select(CreateDataProvider).NotNull().ToList();
+
+                if (dataProviders?.Any() == true) providerCache.AddRange(dataProviders);
+
+                providerMap.Clear();
+
+                return this;
+            }
+
+            public bool LoadDataProvider(Dictionary<string, object> dataProviderConfig)
+            {
+                var provider = CreateDataProvider(dataProviderConfig);
+                if (provider == null) return false;
+
+                providerCache.Insert(0, provider);
+                providerMap.Clear();
+                return true;
+            }
+            public void ClearDataProviders(Predicate<DataProviderCache> predicate = null)
+            {
+                if (predicate != null)
+                    providerCache.RemoveAll(predicate);
+                else
+                    providerCache.Clear();
+
+                providerMap.Clear();
+            }
+
+
+            #region LoadDataProvider
+
+            public IDataProvider DataProvider<Entity>() => DataProvider(typeof(Entity));
+            public IDataProvider DataProvider(Type entityType)
+            {
+                return providerMap.GetOrAdd(entityType, GetDataProviderFromConfig);
+
+                IDataProvider GetDataProviderFromConfig(Type entityType)
+                {
+                    var classFullName = entityType.FullName;
+                    return providerCache.FirstOrDefault(cache => cache.Match(classFullName))?.dataProvider
+                        ?? throw new NotImplementedException("can not find config for type: " + classFullName);
+                }
+            }
+
+            /// <summary>
+            /// dataProviderName:  dataProviderName or dataProviderNamespace
+            /// </summary>
+            /// <param name="dataProviderName"></param>
+            /// <returns></returns>
+            public IDataProvider DataProvider(string dataProviderName)
+            {
+                return providerCache.FirstOrDefault(cache => cache.name == dataProviderName || cache.@namespace == dataProviderName)?.dataProvider;
+            }
+
+
+            readonly ConcurrentDictionary<Type, IDataProvider> providerMap = new();
+
+            readonly List<DataProviderCache> providerCache = new();
+
+
+            DataProviderCache CreateDataProvider(Dictionary<string, object> dataProviderConfig)
+            {
+                /*
+                "provider": "Vitorm.Sqlite.DataProvider",
+                "assemblyName": "Vitorm.Sqlite",
+                "assemblyFile": "Vitorm.Sqlite.dll",
+                 */
+
+                object temp;
+                string provider = dataProviderConfig.TryGetValue("provider", out temp) ? temp as string : null;
+                string assemblyName = dataProviderConfig.TryGetValue("assemblyName", out temp) ? temp as string : null;
+                string assemblyFile = dataProviderConfig.TryGetValue("assemblyFile", out temp) ? temp as string : null;
+
+                Type providerType;
+                IDataProvider dataProvider;
+
+                // #1 load
+                providerType = ObjectLoader.GetType(className: provider, assemblyName: assemblyName, assemblyFile: assemblyFile);
+                dataProvider = providerType?.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }) as IDataProvider;
+
+                // #2 try load by database type (Sqlite/MySql/SqlServer)
+                if (dataProvider == null)
+                {
+                    providerType = ObjectLoader.GetType(className: $"Vitorm.{provider}.DataProvider", assemblyName: $"Vitorm.{provider}", assemblyFile: $"Vitorm.{provider}.dll");
+                    dataProvider = providerType?.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }) as IDataProvider;
+                }
+
+
+                if (dataProvider == null) return null;
+
+                dataProvider.Init(dataProviderConfig);
+                return new DataProviderCache(dataProvider, dataProviderConfig);
+            }
+
+
+            #endregion
+
+
+
+
+            #region CRUD Sync
+
+            // #0 Schema :  TryCreateTable TryDropTable
+            public void TryCreateTable<Entity>() => DataProvider<Entity>().TryCreateTable<Entity>();
+            public void TryDropTable<Entity>() => DataProvider<Entity>().TryDropTable<Entity>();
+            public void Truncate<Entity>() => DataProvider<Entity>().Truncate<Entity>();
+
+
+            // #1 Create :  Add AddRange
+            public Entity Add<Entity>(Entity entity) => DataProvider<Entity>().Add<Entity>(entity);
+            public void AddRange<Entity>(IEnumerable<Entity> entities) => DataProvider<Entity>().AddRange<Entity>(entities);
+
+            // #2 Retrieve : Get Query
+            public Entity Get<Entity>(object keyValue) => DataProvider<Entity>().Get<Entity>(keyValue);
+            public IQueryable<Entity> Query<Entity>() => DataProvider<Entity>().Query<Entity>();
+
+
+            // #3 Update: Update UpdateRange
+            public int Update<Entity>(Entity entity) => DataProvider<Entity>().Update<Entity>(entity);
+            public int UpdateRange<Entity>(IEnumerable<Entity> entities) => DataProvider<Entity>().UpdateRange<Entity>(entities);
+
+
+            // #4 Delete : Delete DeleteRange DeleteByKey DeleteByKeys
+            public int Delete<Entity>(Entity entity) => DataProvider<Entity>().Delete<Entity>(entity);
+            public int DeleteRange<Entity>(IEnumerable<Entity> entities) => DataProvider<Entity>().DeleteRange<Entity>(entities);
+
+            public int DeleteByKey<Entity>(object keyValue) => DataProvider<Entity>().DeleteByKey<Entity>(keyValue);
+            public int DeleteByKeys<Entity, Key>(IEnumerable<Key> keys) => DataProvider<Entity>().DeleteByKeys<Entity, Key>(keys);
+
+            #endregion
+
+
+
+            #region CRUD Async
+
+            // #0 Schema :  TryCreateTable TryDropTable
+            public Task TryCreateTableAsync<Entity>() => DataProvider<Entity>().TryCreateTableAsync<Entity>();
+            public Task TryDropTableAsync<Entity>() => DataProvider<Entity>().TryDropTableAsync<Entity>();
+            public Task TruncateAsync<Entity>() => DataProvider<Entity>().TruncateAsync<Entity>();
+
+
+            // #1 Create :  Add AddRange
+            public Task<Entity> AddAsync<Entity>(Entity entity) => DataProvider<Entity>().AddAsync<Entity>(entity);
+            public Task AddRangeAsync<Entity>(IEnumerable<Entity> entities) => DataProvider<Entity>().AddRangeAsync<Entity>(entities);
+
+            // #2 Retrieve : Get Query
+            public Task<Entity> GetAsync<Entity>(object keyValue) => DataProvider<Entity>().GetAsync<Entity>(keyValue);
+
+
+            // #3 Update: Update UpdateRange
+            public Task<int> UpdateAsync<Entity>(Entity entity) => DataProvider<Entity>().UpdateAsync<Entity>(entity);
+            public Task<int> UpdateRangeAsync<Entity>(IEnumerable<Entity> entities) => DataProvider<Entity>().UpdateRangeAsync<Entity>(entities);
+
+
+            // #4 Delete : Delete DeleteRange DeleteByKey DeleteByKeys
+            public Task<int> DeleteAsync<Entity>(Entity entity) => DataProvider<Entity>().DeleteAsync<Entity>(entity);
+            public Task<int> DeleteRangeAsync<Entity>(IEnumerable<Entity> entities) => DataProvider<Entity>().DeleteRangeAsync<Entity>(entities);
+
+            public Task<int> DeleteByKeyAsync<Entity>(object keyValue) => DataProvider<Entity>().DeleteByKeyAsync<Entity>(keyValue);
+            public Task<int> DeleteByKeysAsync<Entity, Key>(IEnumerable<Key> keys) => DataProvider<Entity>().DeleteByKeysAsync<Entity, Key>(keys);
+
+            #endregion
+
+        }
+    }
+}

+ 55 - 124
src/Vitorm.Data/Data.cs

@@ -1,5 +1,4 @@
 using System;
-using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
@@ -15,10 +14,13 @@ namespace Vitorm
 {
     public partial class Data
     {
+        public static DataSource dataSource = new DataSource();
+
         static Data()
         {
             Init(Appsettings.json);
         }
+
         /// <summary>
         /// Data.Init("appsettings.Development.json")
         /// </summary>
@@ -27,123 +29,52 @@ namespace Vitorm
         {
             Init(new JsonFile(appsettingsFileName));
         }
+
         public static void Init(JsonFile json)
         {
-            #region #1 load dataProvider
-            {
-                var dataSourceConfigs = json.GetByPath<List<Dictionary<string, object>>>("Vitorm.Data");
-                var dataProviders = dataSourceConfigs?.Select(CreateDataProvider).NotNull().ToList();
+            // #1 load dataProviders
+            dataSource.LoadDataProviders(json);
 
-                if (dataProviders?.Any() == true) providerCache.AddRange(dataProviders);
-            }
-            #endregion
 
-
-            #region #2 load entityLoader
-            {
-                var configs = json.GetByPath<List<Dictionary<string, object>>>("Vitorm.EntityLoader");
-                configs?.ForEach(config =>
-                {
-                    object temp;
-                    string className = config.TryGetValue("className", out temp) ? temp as string : null;
-                    string assemblyFile = config.TryGetValue("assemblyFile", out temp) ? temp as string : null;
-                    string assemblyName = config.TryGetValue("assemblyName", out temp) ? temp as string : null;
-
-                    int index = config.TryGetValue("index", out temp) && temp is int i ? i : 0;
-
-                    var entityLoader = ObjectLoader.CreateInstance(className, assemblyFile: assemblyFile, assemblyName: assemblyName) as IEntityLoader;
-                    if (entityLoader == null) return;
-
-                    EntityLoaders.Instance.loaders.Insert(index, entityLoader);
-                });
-            }
-            #endregion
+            // #2 load DefaultEntityLoaders
+            var entityLoaderConfigs = json.GetByPath<List<Dictionary<string, object>>>("Vitorm.EntityLoader");
+            LoadDefaultEntityLoaders(entityLoaderConfigs);
         }
 
-        public static bool AddDataSource(Dictionary<string, object> dataSourceConfig)
+        public static void LoadDefaultEntityLoaders(IEnumerable<Dictionary<string, object>> entityLoaderConfigs)
         {
-            var provider = CreateDataProvider(dataSourceConfig);
-            if (provider == null) return false;
+            entityLoaderConfigs?.ForEach(config =>
+            {
+                object temp;
+                string className = config.TryGetValue("className", out temp) ? temp as string : null;
+                string assemblyFile = config.TryGetValue("assemblyFile", out temp) ? temp as string : null;
+                string assemblyName = config.TryGetValue("assemblyName", out temp) ? temp as string : null;
 
-            providerCache.Insert(0, provider);
-            providerMap.Clear();
-            return true;
-        }
-        public static void ClearDataSource(Predicate<DataProviderCache> predicate = null)
-        {
-            if (predicate != null)
-                providerCache.RemoveAll(predicate);
-            else
-                providerCache.Clear();
-            providerMap.Clear();
+                int index = config.TryGetValue("index", out temp) && temp is int i ? i : 0;
+
+                var entityLoader = ObjectLoader.CreateInstance(className, assemblyFile: assemblyFile, assemblyName: assemblyName) as IEntityLoader;
+                if (entityLoader == null) return;
+
+                EntityLoaders.Instance.loaders.Insert(index, entityLoader);
+            });
         }
 
+        public static bool LoadDataProvider(Dictionary<string, object> dataProviderConfig) => dataSource.LoadDataProvider(dataProviderConfig);
 
-        #region LoadDataProvider
+        public static void ClearDataProviders(Predicate<DataProviderCache> predicate = null) => dataSource.ClearDataProviders(predicate);
 
-        public static IDataProvider DataProvider<Entity>() => DataProvider(typeof(Entity));
-        public static IDataProvider DataProvider(Type entityType)
-        {
-            return providerMap.GetOrAdd(entityType, GetDataProviderFromConfig);
 
-            static IDataProvider GetDataProviderFromConfig(Type entityType)
-            {
-                var classFullName = entityType.FullName;
-                return providerCache.FirstOrDefault(cache => cache.Match(classFullName))?.dataProvider
-                    ?? throw new NotImplementedException("can not find config for type: " + classFullName);
-            }
-        }
+        #region LoadDataProvider
+
+        public static IDataProvider DataProvider<Entity>() => dataSource.DataProvider<Entity>();
+        public static IDataProvider DataProvider(Type entityType) => dataSource.DataProvider(entityType);
 
         /// <summary>
         /// dataProviderName:  dataProviderName or dataProviderNamespace
         /// </summary>
         /// <param name="dataProviderName"></param>
         /// <returns></returns>
-        public static IDataProvider DataProvider(string dataProviderName)
-        {
-            return providerCache.FirstOrDefault(cache => cache.name == dataProviderName || cache.@namespace == dataProviderName)?.dataProvider;
-        }
-
-
-        static readonly ConcurrentDictionary<Type, IDataProvider> providerMap = new();
-
-        static readonly List<DataProviderCache> providerCache = new();
-
-
-        static DataProviderCache CreateDataProvider(Dictionary<string, object> dataSourceConfig)
-        {
-            /*
-            "provider": "Vitorm.Sqlite.DataProvider",
-            "assemblyName": "Vitorm.Sqlite",
-            "assemblyFile": "Vitorm.Sqlite.dll",
-             */
-
-            object temp;
-            string provider = dataSourceConfig.TryGetValue("provider", out temp) ? temp as string : null;
-            string assemblyName = dataSourceConfig.TryGetValue("assemblyName", out temp) ? temp as string : null;
-            string assemblyFile = dataSourceConfig.TryGetValue("assemblyFile", out temp) ? temp as string : null;
-
-            Type providerType;
-            IDataProvider dataProvider;
-
-            // #1 load
-            providerType = ObjectLoader.GetType(className: provider, assemblyName: assemblyName, assemblyFile: assemblyFile);
-            dataProvider = providerType?.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }) as IDataProvider;
-
-            // #2 try load by database type (Sqlite/MySql/SqlServer)
-            if (dataProvider == null)
-            {
-                providerType = ObjectLoader.GetType(className: $"Vitorm.{provider}.DataProvider", assemblyName: $"Vitorm.{provider}", assemblyFile: $"Vitorm.{provider}.dll");
-                dataProvider = providerType?.GetConstructor(Type.EmptyTypes)?.Invoke(new object[] { }) as IDataProvider;
-            }
-
-
-            if (dataProvider == null) return null;
-
-            dataProvider.Init(dataSourceConfig);
-            return new DataProviderCache(dataProvider, dataSourceConfig);
-        }
-
+        public static IDataProvider DataProvider(string dataProviderName) => dataSource.DataProvider(dataProviderName);
 
         #endregion
 
@@ -153,31 +84,31 @@ namespace Vitorm
         #region CRUD Sync
 
         // #0 Schema :  TryCreateTable TryDropTable
-        public static void TryCreateTable<Entity>() => DataProvider<Entity>().TryCreateTable<Entity>();
-        public static void TryDropTable<Entity>() => DataProvider<Entity>().TryDropTable<Entity>();
-        public static void Truncate<Entity>() => DataProvider<Entity>().Truncate<Entity>();
+        public static void TryCreateTable<Entity>() => dataSource.TryCreateTable<Entity>();
+        public static void TryDropTable<Entity>() => dataSource.TryDropTable<Entity>();
+        public static void Truncate<Entity>() => dataSource.Truncate<Entity>();
 
 
         // #1 Create :  Add AddRange
-        public static Entity Add<Entity>(Entity entity) => DataProvider<Entity>().Add<Entity>(entity);
-        public static void AddRange<Entity>(IEnumerable<Entity> entities) => DataProvider<Entity>().AddRange<Entity>(entities);
+        public static Entity Add<Entity>(Entity entity) => dataSource.Add<Entity>(entity);
+        public static void AddRange<Entity>(IEnumerable<Entity> entities) => dataSource.AddRange<Entity>(entities);
 
         // #2 Retrieve : Get Query
-        public static Entity Get<Entity>(object keyValue) => DataProvider<Entity>().Get<Entity>(keyValue);
-        public static IQueryable<Entity> Query<Entity>() => DataProvider<Entity>().Query<Entity>();
+        public static Entity Get<Entity>(object keyValue) => dataSource.Get<Entity>(keyValue);
+        public static IQueryable<Entity> Query<Entity>() => dataSource.Query<Entity>();
 
 
         // #3 Update: Update UpdateRange
-        public static int Update<Entity>(Entity entity) => DataProvider<Entity>().Update<Entity>(entity);
-        public static int UpdateRange<Entity>(IEnumerable<Entity> entities) => DataProvider<Entity>().UpdateRange<Entity>(entities);
+        public static int Update<Entity>(Entity entity) => dataSource.Update<Entity>(entity);
+        public static int UpdateRange<Entity>(IEnumerable<Entity> entities) => dataSource.UpdateRange<Entity>(entities);
 
 
         // #4 Delete : Delete DeleteRange DeleteByKey DeleteByKeys
-        public static int Delete<Entity>(Entity entity) => DataProvider<Entity>().Delete<Entity>(entity);
-        public static int DeleteRange<Entity>(IEnumerable<Entity> entities) => DataProvider<Entity>().DeleteRange<Entity>(entities);
+        public static int Delete<Entity>(Entity entity) => dataSource.Delete<Entity>(entity);
+        public static int DeleteRange<Entity>(IEnumerable<Entity> entities) => dataSource.DeleteRange<Entity>(entities);
 
-        public static int DeleteByKey<Entity>(object keyValue) => DataProvider<Entity>().DeleteByKey<Entity>(keyValue);
-        public static int DeleteByKeys<Entity, Key>(IEnumerable<Key> keys) => DataProvider<Entity>().DeleteByKeys<Entity, Key>(keys);
+        public static int DeleteByKey<Entity>(object keyValue) => dataSource.DeleteByKey<Entity>(keyValue);
+        public static int DeleteByKeys<Entity, Key>(IEnumerable<Key> keys) => dataSource.DeleteByKeys<Entity, Key>(keys);
 
         #endregion
 
@@ -186,30 +117,30 @@ namespace Vitorm
         #region CRUD Async
 
         // #0 Schema :  TryCreateTable TryDropTable
-        public static Task TryCreateTableAsync<Entity>() => DataProvider<Entity>().TryCreateTableAsync<Entity>();
-        public static Task TryDropTableAsync<Entity>() => DataProvider<Entity>().TryDropTableAsync<Entity>();
-        public static Task TruncateAsync<Entity>() => DataProvider<Entity>().TruncateAsync<Entity>();
+        public static Task TryCreateTableAsync<Entity>() => dataSource.TryCreateTableAsync<Entity>();
+        public static Task TryDropTableAsync<Entity>() => dataSource.TryDropTableAsync<Entity>();
+        public static Task TruncateAsync<Entity>() => dataSource.TruncateAsync<Entity>();
 
 
         // #1 Create :  Add AddRange
-        public static Task<Entity> AddAsync<Entity>(Entity entity) => DataProvider<Entity>().AddAsync<Entity>(entity);
-        public static Task AddRangeAsync<Entity>(IEnumerable<Entity> entities) => DataProvider<Entity>().AddRangeAsync<Entity>(entities);
+        public static Task<Entity> AddAsync<Entity>(Entity entity) => dataSource.AddAsync<Entity>(entity);
+        public static Task AddRangeAsync<Entity>(IEnumerable<Entity> entities) => dataSource.AddRangeAsync<Entity>(entities);
 
         // #2 Retrieve : Get Query
-        public static Task<Entity> GetAsync<Entity>(object keyValue) => DataProvider<Entity>().GetAsync<Entity>(keyValue);
+        public static Task<Entity> GetAsync<Entity>(object keyValue) => dataSource.GetAsync<Entity>(keyValue);
 
 
         // #3 Update: Update UpdateRange
-        public static Task<int> UpdateAsync<Entity>(Entity entity) => DataProvider<Entity>().UpdateAsync<Entity>(entity);
-        public static Task<int> UpdateRangeAsync<Entity>(IEnumerable<Entity> entities) => DataProvider<Entity>().UpdateRangeAsync<Entity>(entities);
+        public static Task<int> UpdateAsync<Entity>(Entity entity) => dataSource.UpdateAsync<Entity>(entity);
+        public static Task<int> UpdateRangeAsync<Entity>(IEnumerable<Entity> entities) => dataSource.UpdateRangeAsync<Entity>(entities);
 
 
         // #4 Delete : Delete DeleteRange DeleteByKey DeleteByKeys
-        public static Task<int> DeleteAsync<Entity>(Entity entity) => DataProvider<Entity>().DeleteAsync<Entity>(entity);
-        public static Task<int> DeleteRangeAsync<Entity>(IEnumerable<Entity> entities) => DataProvider<Entity>().DeleteRangeAsync<Entity>(entities);
+        public static Task<int> DeleteAsync<Entity>(Entity entity) => dataSource.DeleteAsync<Entity>(entity);
+        public static Task<int> DeleteRangeAsync<Entity>(IEnumerable<Entity> entities) => dataSource.DeleteRangeAsync<Entity>(entities);
 
-        public static Task<int> DeleteByKeyAsync<Entity>(object keyValue) => DataProvider<Entity>().DeleteByKeyAsync<Entity>(keyValue);
-        public static Task<int> DeleteByKeysAsync<Entity, Key>(IEnumerable<Key> keys) => DataProvider<Entity>().DeleteByKeysAsync<Entity, Key>(keys);
+        public static Task<int> DeleteByKeyAsync<Entity>(object keyValue) => dataSource.DeleteByKeyAsync<Entity>(keyValue);
+        public static Task<int> DeleteByKeysAsync<Entity, Key>(IEnumerable<Key> keys) => dataSource.DeleteByKeysAsync<Entity, Key>(keys);
 
         #endregion
 

+ 1 - 1
src/Vitorm.Data/README.md

@@ -12,7 +12,7 @@ This means you get the best of both worlds: the performance and simplicity of Da
 
 | Build | NuGet |
 | -------- | -------- |
-|![](https://github.com/Vit-Orm/Vitorm/workflows/ki_devops3/badge.svg) | [![](https://img.shields.io/nuget/v/Vitorm.Data.svg)](https://www.nuget.org/packages/Vitorm.Data) ![](https://img.shields.io/nuget/dt/Vitorm.Data.svg) |
+|![](https://github.com/Vit-Orm/Vitorm/workflows/ki_devops3_build/badge.svg) | [![](https://img.shields.io/nuget/v/Vitorm.Data.svg)](https://www.nuget.org/packages/Vitorm.Data) ![](https://img.shields.io/nuget/dt/Vitorm.Data.svg) |
 
 
 

+ 1 - 1
src/Vitorm.Data/Vitorm.Data.csproj

@@ -1,4 +1,5 @@
 <Project Sdk="Microsoft.NET.Sdk">
+    <Import Project="..\Versions.props" />
 
     <PropertyGroup>
         <pack>nuget</pack>
@@ -6,7 +7,6 @@
 
     <PropertyGroup>
         <TargetFramework>netstandard2.0</TargetFramework>
-        <Version>2.1.1</Version>
         <LangVersion>9.0</LangVersion>
     </PropertyGroup>
 

+ 1 - 1
src/Vitorm.EntityGenerate/README.md

@@ -9,7 +9,7 @@ Library to generate Entity Type from Database
 
 | Build | NuGet |
 | -------- | -------- |
-|![](https://github.com/Vit-Orm/Vitorm/workflows/ki_devops3/badge.svg) | [![](https://img.shields.io/nuget/v/Vitorm.EntityGenerate.svg)](https://www.nuget.org/packages/Vitorm.EntityGenerate) ![](https://img.shields.io/nuget/dt/Vitorm.EntityGenerate.svg) |
+|![](https://github.com/Vit-Orm/Vitorm/workflows/ki_devops3_build/badge.svg) | [![](https://img.shields.io/nuget/v/Vitorm.EntityGenerate.svg)](https://www.nuget.org/packages/Vitorm.EntityGenerate) ![](https://img.shields.io/nuget/dt/Vitorm.EntityGenerate.svg) |
 
 
 

+ 1 - 1
src/Vitorm.EntityGenerate/Vitorm.EntityGenerate.csproj

@@ -1,4 +1,5 @@
 <Project Sdk="Microsoft.NET.Sdk">
+    <Import Project="..\Versions.props" />
 
     <PropertyGroup>
         <pack>nuget</pack>
@@ -6,7 +7,6 @@
 
     <PropertyGroup>
         <TargetFramework>netstandard2.0</TargetFramework>
-        <Version>2.1.1</Version>
         <LangVersion>9.0</LangVersion>
     </PropertyGroup>
 

+ 1 - 1
src/Vitorm.MySql/README.md

@@ -12,7 +12,7 @@ This means you get the best of both worlds: the performance and simplicity of Da
 
 | Build | NuGet |
 | -------- | -------- |
-|![](https://github.com/Vit-Orm/Vitorm/workflows/ki_devops3/badge.svg) | [![](https://img.shields.io/nuget/v/Vitorm.MySql.svg)](https://www.nuget.org/packages/Vitorm.MySql) ![](https://img.shields.io/nuget/dt/Vitorm.MySql.svg) |
+|![](https://github.com/Vit-Orm/Vitorm/workflows/ki_devops3_build/badge.svg) | [![](https://img.shields.io/nuget/v/Vitorm.MySql.svg)](https://www.nuget.org/packages/Vitorm.MySql) ![](https://img.shields.io/nuget/dt/Vitorm.MySql.svg) |
 
 
 

+ 1 - 1
src/Vitorm.MySql/Vitorm.MySql.csproj

@@ -1,4 +1,5 @@
 <Project Sdk="Microsoft.NET.Sdk">
+    <Import Project="..\Versions.props" />
 
     <PropertyGroup>
         <pack>nuget</pack>
@@ -6,7 +7,6 @@
 
     <PropertyGroup>
         <TargetFramework>netstandard2.0</TargetFramework>
-        <Version>2.1.1</Version>
         <LangVersion>9.0</LangVersion>
     </PropertyGroup>
 

+ 1 - 1
src/Vitorm.SqlServer/README.md

@@ -12,7 +12,7 @@ This means you get the best of both worlds: the performance and simplicity of Da
 
 | Build | NuGet |
 | -------- | -------- |
-|![](https://github.com/Vit-Orm/Vitorm/workflows/ki_devops3/badge.svg) | [![](https://img.shields.io/nuget/v/Vitorm.SqlServer.svg)](https://www.nuget.org/packages/Vitorm.SqlServer) ![](https://img.shields.io/nuget/dt/Vitorm.SqlServer.svg) |
+|![](https://github.com/Vit-Orm/Vitorm/workflows/ki_devops3_build/badge.svg) | [![](https://img.shields.io/nuget/v/Vitorm.SqlServer.svg)](https://www.nuget.org/packages/Vitorm.SqlServer) ![](https://img.shields.io/nuget/dt/Vitorm.SqlServer.svg) |
 
 
 

+ 1 - 1
src/Vitorm.SqlServer/Vitorm.SqlServer.csproj

@@ -1,4 +1,5 @@
 <Project Sdk="Microsoft.NET.Sdk">
+    <Import Project="..\Versions.props" />
 
     <PropertyGroup>
         <pack>nuget</pack>
@@ -6,7 +7,6 @@
 
     <PropertyGroup>
         <TargetFramework>netstandard2.0</TargetFramework>
-        <Version>2.1.1</Version>
         <LangVersion>9.0</LangVersion>
     </PropertyGroup>
 

+ 1 - 1
src/Vitorm.Sqlite/README.md

@@ -12,7 +12,7 @@ This means you get the best of both worlds: the performance and simplicity of Da
 
 | Build | NuGet |
 | -------- | -------- |
-|![](https://github.com/Vit-Orm/Vitorm/workflows/ki_devops3/badge.svg) | [![](https://img.shields.io/nuget/v/Vitorm.Sqlite.svg)](https://www.nuget.org/packages/Vitorm.Sqlite) ![](https://img.shields.io/nuget/dt/Vitorm.Sqlite.svg) |
+|![](https://github.com/Vit-Orm/Vitorm/workflows/ki_devops3_build/badge.svg) | [![](https://img.shields.io/nuget/v/Vitorm.Sqlite.svg)](https://www.nuget.org/packages/Vitorm.Sqlite) ![](https://img.shields.io/nuget/dt/Vitorm.Sqlite.svg) |
 
 
 

+ 1 - 1
src/Vitorm.Sqlite/Vitorm.Sqlite.csproj

@@ -1,4 +1,5 @@
 <Project Sdk="Microsoft.NET.Sdk">
+    <Import Project="..\Versions.props" />
 
     <PropertyGroup>
         <pack>nuget</pack>
@@ -6,7 +7,6 @@
 
     <PropertyGroup>
         <TargetFramework>netstandard2.0</TargetFramework>
-        <Version>2.1.1</Version>
         <LangVersion>9.0</LangVersion>
     </PropertyGroup>
 

+ 3 - 3
src/Vitorm/Vitorm.csproj

@@ -1,4 +1,5 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
+    <Import Project="..\Versions.props" />
 
     <PropertyGroup>
         <pack>nuget</pack>
@@ -6,7 +7,6 @@
 
     <PropertyGroup>
         <TargetFramework>netstandard2.0</TargetFramework>
-        <Version>2.1.1</Version>
         <LangVersion>9.0</LangVersion>
     </PropertyGroup>
 
@@ -32,7 +32,7 @@
 
     <ItemGroup>
         <PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
-        <PackageReference Include="Vit.Linq" Version="[3.1.1, 3.2.0)" />
+        <PackageReference Include="Vit.Linq" Version="$(VitLinq_Version)" />
     </ItemGroup>
 
 </Project>