Lith 4 сар өмнө
parent
commit
636d4c34ea

+ 6 - 1
Publish/DevOps3/README.md

@@ -1,5 +1,5 @@
 
-# DevOps 3.7
+# DevOps 3.8
 
 
 # build-bash
@@ -24,6 +24,11 @@ if this file exists, will not need approval for jenkins build.
 ----------------------------------------------
 # ReleaseLog
 
+-----------------------
+# 3.8
+> 2024-12-19
+- upgrade net to 8.0
+
 -----------------------
 # 3.7
 > 2024-09-21

+ 1 - 1
Publish/DevOps3/build-bash/10.Test.bash

@@ -37,7 +37,7 @@ docker run -i --rm \
 -v $NUGET_PATH:/root/.nuget \
 -v "$basePath":/root/code \
 -v "$basePath":"$basePath" \
-serset/dotnet:sdk-6.0 \
+serset/dotnet:sdk-8.0 \
 bash -c "
 set -e
 

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

@@ -22,7 +22,7 @@ docker run -i --rm \
 --env LANG=C.UTF-8 \
 -v $NUGET_PATH:/root/.nuget \
 -v $basePath:/root/code \
-serset/dotnet:sdk-6.0 \
+serset/dotnet:sdk-8.0 \
 bash -c "
 
 publishPath=/root/code/Publish/release/release/nuget

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

@@ -23,7 +23,7 @@ docker run -i --rm \
 -v $NUGET_PATH:/root/.nuget \
 -v "$basePath":/root/code \
 -v "$basePath":"$basePath" \
-serset/dotnet:sdk-6.0 \
+serset/dotnet:sdk-8.0 \
 bash -c "
 set -e
 

+ 1 - 1
Publish/DevOps3/release-bash/72.nuget-push.sh

@@ -25,7 +25,7 @@ fi
 docker run -i --rm \
 --env LANG=C.UTF-8 \
 -v $basePath:/root/code \
-serset/dotnet:sdk-6.0 \
+serset/dotnet:sdk-8.0 \
 bash -c "
 for file in /root/code/Publish/release/release/nuget/*.nupkg
 do

+ 6 - 0
doc/ReleaseNotes.md

@@ -0,0 +1,6 @@
+# Vitorm.MongoDB ReleaseNotes
+
+-----------------------
+# 2.4.0
+- upgrade net to 8.0
+

+ 2 - 2
src/Versions.props

@@ -1,7 +1,7 @@
 <Project>
     <PropertyGroup>
-        <Version>develop</Version>
-        <Vitorm_Version>[2.2.2, 2.3.0)</Vitorm_Version>
+        <Version>2.4.0-develop</Version>
+        <Vitorm_Version>[2.4.0, 2.5.0)</Vitorm_Version>
     </PropertyGroup>
 
     <PropertyGroup>

+ 3 - 3
src/Vitorm.PostgreSQL/SqlTranslateService.cs

@@ -185,7 +185,7 @@ CREATE TABLE IF NOT exists "User" (
             List<string> sqlFields = new();
 
             // #1 columns
-            entityDescriptor.allColumns?.ForEach(column => sqlFields.Add(GetColumnSql(column)));
+            entityDescriptor.properties?.ForEach(column => sqlFields.Add(GetColumnSql(column)));
 
             return $@"
 CREATE TABLE IF NOT EXISTS {DelimitTableName(entityDescriptor)} (
@@ -193,7 +193,7 @@ CREATE TABLE IF NOT EXISTS {DelimitTableName(entityDescriptor)} (
 )
 ;";
 
-            string GetColumnSql(IColumnDescriptor column)
+            string GetColumnSql(IPropertyDescriptor column)
             {
                 var columnDbType = column.columnDbType ?? GetColumnDbType(column);
                 var defaultValue = column.isNullable ? "default null" : "";
@@ -236,7 +236,7 @@ CREATE TABLE IF NOT EXISTS {DelimitTableName(entityDescriptor)} (
             //[typeof(Guid)] = "UUID",
         };
 
-        protected override string GetColumnDbType(IColumnDescriptor column)
+        protected override string GetColumnDbType(IPropertyDescriptor column)
         {
             Type type = column.type;
 

+ 9 - 2
src/Vitorm.PostgreSQL/Vitorm.PostgreSQL.csproj

@@ -6,7 +6,7 @@
     </PropertyGroup>
 
     <PropertyGroup>
-        <TargetFramework>netstandard2.0</TargetFramework>
+        <TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
         <LangVersion>9.0</LangVersion>
     </PropertyGroup>
 
@@ -31,8 +31,15 @@
         </None>
     </ItemGroup>
 
+    <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' Or '$(TargetFramework)' == 'netstandard2.1'">
+        <PackageReference Include="Npgsql" Version="8.0.6" />
+    </ItemGroup>
+
+    <ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
+        <PackageReference Include="Npgsql" Version="9.0.2" />
+    </ItemGroup>
+
     <ItemGroup>
-        <PackageReference Include="Npgsql" Version="8.0.4" />
         <PackageReference Include="Vitorm" Version="$(Vitorm_Version)" />
     </ItemGroup>
 

+ 4 - 4
test/Vitorm.PostgreSQL.Data.MsTest/Vitorm.PostgreSQL.Data.MsTest.csproj

@@ -6,7 +6,7 @@
     </PropertyGroup>
 
     <PropertyGroup>
-        <TargetFramework>net6.0</TargetFramework>
+        <TargetFramework>net8.0</TargetFramework>
         <ImplicitUsings>enable</ImplicitUsings>
 
         <IsPackable>false</IsPackable>
@@ -15,9 +15,9 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
-        <PackageReference Include="MSTest.TestAdapter" Version="3.6.1" />
-        <PackageReference Include="MSTest.TestFramework" Version="3.6.1" />
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
+        <PackageReference Include="MSTest.TestAdapter" Version="3.7.0" />
+        <PackageReference Include="MSTest.TestFramework" Version="3.7.0" />
 
         <PackageReference Include="Vit.Core" Version="2.3.0" />
         <PackageReference Include="Vitorm.Data" Version="$(Vitorm_Version)" />

+ 10 - 5
test/Vitorm.PostgreSQL.MsTest/CommonTest/EntityLoader_CustomLoader_Test.cs

@@ -4,6 +4,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
 
 using Vitorm.Entity;
 using Vitorm.Entity.Loader.DataAnnotations;
+using Vitorm.Entity.PropertyType;
 
 namespace Vitorm.MsTest.CommonTest
 {
@@ -120,7 +121,7 @@ namespace Vitorm.MsTest.CommonTest
             {
                 if (!GetTableName(entityType, out var tableName, out var schema)) return default;
 
-                IColumnDescriptor[] allColumns = entityType?.GetProperties(BindingFlags.Public | BindingFlags.Instance)
+                var propertyDescriptors = entityType?.GetProperties(BindingFlags.Public | BindingFlags.Instance)
                     .Select(propertyInfo =>
                     {
                         var labels = propertyInfo?.GetCustomAttributes<LabelAttribute>();
@@ -152,15 +153,19 @@ namespace Vitorm.MsTest.CommonTest
                             }
                         }
 
-                        return new ColumnDescriptor(
-                            propertyInfo, columnName: columnName,
+                        return new PropertyDescriptor(
+                            propertyInfo, propertyType: new PropertyValueType(propertyInfo.PropertyType),
+                        columnName: columnName,
                             isKey: isKey, isIdentity: isIdentity, isNullable: isNullable,
                             columnDbType: columnDbType,
                             columnOrder: columnOrder
                             );
-                    }).Where(column => column != null).ToArray();
+                    }).Where(column => column != null);
 
-                return (true, new EntityDescriptor(entityType, allColumns, tableName, schema));
+                var propertyType = new PropertyObjectType(entityType);
+                propertyType.properties = propertyDescriptors.Select(m => (IPropertyDescriptor)m).ToArray();
+
+                return (true, new EntityDescriptor(propertyType, tableName, schema));
             }
         }
         #endregion

+ 4 - 4
test/Vitorm.PostgreSQL.MsTest/Vitorm.PostgreSQL.MsTest.csproj

@@ -5,7 +5,7 @@
     </PropertyGroup>
 
     <PropertyGroup>
-        <TargetFramework>net6.0</TargetFramework>
+        <TargetFramework>net8.0</TargetFramework>
         <ImplicitUsings>enable</ImplicitUsings>
 
         <IsPackable>false</IsPackable>
@@ -14,9 +14,9 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
-        <PackageReference Include="MSTest.TestAdapter" Version="3.6.1" />
-        <PackageReference Include="MSTest.TestFramework" Version="3.6.1" />
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
+        <PackageReference Include="MSTest.TestAdapter" Version="3.7.0" />
+        <PackageReference Include="MSTest.TestFramework" Version="3.7.0" />
 
         <PackageReference Include="Vit.Core" Version="2.3.0" />
     </ItemGroup>