gongqiuhong 2 ay önce
ebeveyn
işleme
45ed95374a

+ 2 - 2
AdService/AdService.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
 
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFramework>net8.0</TargetFramework>
 	<ImplicitUsings>enable</ImplicitUsings>
 	<Nullable>disable</Nullable>
 	<GenerateDocumentationFile>True</GenerateDocumentationFile>
@@ -9,7 +9,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.20" />
+    <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.14" />
   </ItemGroup>
 
   <ItemGroup>

+ 1 - 1
DW5S.Basic/01.DW5S.Basic.csproj

@@ -8,7 +8,7 @@
 
 	<ItemGroup>
 		<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
-		<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
+		<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
 		<PackageReference Include="System.Configuration.ConfigurationManager" Version="9.0.3" />
 	</ItemGroup>
 

+ 1 - 1
DW5S.Entity/03.DW5S.Entity.csproj

@@ -18,6 +18,6 @@
 		<ProjectReference Include="..\DW5S.DTO\02.DW5S.DTO.csproj" />
 	</ItemGroup>
 	<ItemGroup>
-		<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.20" />
+		<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.3" />
 	</ItemGroup>
 </Project>

+ 7 - 7
DW5S.Repostory/04.DW5S.Repostory.csproj

@@ -7,19 +7,19 @@
 	</PropertyGroup>
 	<ItemGroup>
 		<PackageReference Include="Autofac" Version="8.2.0" />
-		<PackageReference Include="EFCore.NamingConventions" Version="7.0.2" />
-		<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.20" />
-		<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.20">
+		<PackageReference Include="EFCore.NamingConventions" Version="9.0.0" />
+		<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.3" />
+		<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.3">
 			<PrivateAssets>all</PrivateAssets>
 			<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
 		</PackageReference>
-		<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.20" />
-		<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.2" />
-		<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.20">
+		<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.3" />
+		<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.3" />
+		<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.3">
 			<PrivateAssets>all</PrivateAssets>
 			<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
 		</PackageReference>
-		<PackageReference Include="Oracle.EntityFrameworkCore" Version="7.21.13" />
+		<PackageReference Include="Oracle.EntityFrameworkCore" Version="9.23.60" />
 		<PackageReference Include="SQLitePCLRaw.provider.e_sqlite3" Version="2.1.11" />
 	</ItemGroup>
 	<ItemGroup>

+ 8 - 2
DW5S.Repostory/EFContext/OracleContext.cs

@@ -67,8 +67,14 @@ namespace DW5S.Repostory
                 options =>
                 {
                     //options.MigrationsAssembly("Ips.Sps.Repostory");
-                    options.UseOracleSQLCompatibility("11");//11=Oracle11g,12=Oracle12c
+                    //options.UseOracleSQLCompatibility("11");//11=Oracle11g,12=Oracle12c,EFCore8不支持老版数据库了
 
+                    //使用全局拆分查询,将带集合导航的查询拆分为多条SQL执行,避免结果发生笛卡尔爆炸
+                    options.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
+
+                    //true:生成数据库null语意,如 select * from Products where Name is null;
+                    //false:生成c# null语意,如 select * from Products where Name = null;
+                    //options.UseRelationalNulls(true);
                 })
                 //.UseSnakeCaseNamingConvention()//FullName->full_name
                 //.UseLowerCaseNamingConvention()//FullName->fullname
@@ -114,7 +120,7 @@ namespace DW5S.Repostory
                 .HasDatabaseName("IX_CGRES_TASKID_TIME_FREQ");
             modelBuilder.Entity<PosRes>().HasIndex(p => new { p.TaskID, p.SigTime, p.FrequpHz })
                 .HasDatabaseName("IX_POSRES_TASKID_TIME_FREQ");
-            
+
 
 
         }

+ 3 - 3
DW5S.WebApi/05.DW5S.WebApi.csproj

@@ -1,4 +1,4 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
 	<PropertyGroup>
 		<TargetFramework>net8.0</TargetFramework>
 		<RootNamespace>WebApi</RootNamespace>
@@ -14,8 +14,8 @@
 		<PackageReference Include="Grpc.AspNetCore" Version="2.70.0" />
 		<PackageReference Include="Autofac" Version="8.2.0" />
 		<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
-		<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.20" />
-		<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
+		<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.14" />
+		<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.3" />
 		<PackageReference Include="Swashbuckle.AspNetCore" Version="7.3.1" />
 	</ItemGroup>
 	<ItemGroup>

+ 7 - 1
DW5S.sln

@@ -21,12 +21,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "06.DW5S.KxcApi", "DW5S.KxcA
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "07.DW5S.Service", "DW5S.Service\07.DW5S.Service.csproj", "{93EC0C7B-5E8C-4F2F-B773-5F19330C06AE}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "09.DW5S.ViewModel", "DW5S.ViewModel\09.DW5S.ViewModel.csproj", "{5D3296E4-851B-4D85-9578-62068DD8551C}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "09.DW5S.ViewModel", "DW5S.ViewModel\09.DW5S.ViewModel.csproj", "{5D3296E4-851B-4D85-9578-62068DD8551C}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdService", "AdService\AdService.csproj", "{DE3D49C4-E632-4B93-B17A-C37A71490111}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GpuService", "GpuService\GpuService.csproj", "{8DFE5755-CD4B-46C7-B9A5-C0745241D288}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject1", "TestProject1\TestProject1.csproj", "{5D72FACF-B80A-4FC8-9D08-BA50D1A0E5B3}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -81,6 +83,10 @@ Global
 		{8DFE5755-CD4B-46C7-B9A5-C0745241D288}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{8DFE5755-CD4B-46C7-B9A5-C0745241D288}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{8DFE5755-CD4B-46C7-B9A5-C0745241D288}.Release|Any CPU.Build.0 = Release|Any CPU
+		{5D72FACF-B80A-4FC8-9D08-BA50D1A0E5B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{5D72FACF-B80A-4FC8-9D08-BA50D1A0E5B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{5D72FACF-B80A-4FC8-9D08-BA50D1A0E5B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{5D72FACF-B80A-4FC8-9D08-BA50D1A0E5B3}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 2 - 2
GpuService/GpuService.csproj

@@ -1,13 +1,13 @@
 <Project Sdk="Microsoft.NET.Sdk.Web">
 
   <PropertyGroup>
-    <TargetFramework>net7.0</TargetFramework>
+    <TargetFramework>net8.0</TargetFramework>
     <Nullable>enable</Nullable>
     <ImplicitUsings>enable</ImplicitUsings>
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.20" />
+    <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.14" />
     <PackageReference Include="Swashbuckle.AspNetCore" Version="7.3.1" />
   </ItemGroup>
 

+ 4 - 0
TestProject1/GlobalUsings.cs

@@ -0,0 +1,4 @@
+global using Microsoft.Playwright.MSTest;
+global using Microsoft.VisualStudio.TestTools.UnitTesting;
+global using System.Text.RegularExpressions;
+global using System.Threading.Tasks;

+ 20 - 0
TestProject1/TestProject1.csproj

@@ -0,0 +1,20 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net8.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+
+    <IsPackable>false</IsPackable>
+    <IsTestProject>true</IsTestProject>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
+    <PackageReference Include="MSTest.TestAdapter" Version="3.0.4" />
+    <PackageReference Include="MSTest.TestFramework" Version="3.0.4" />
+    <PackageReference Include="Microsoft.Playwright.MSTest" Version="1.27.1" />
+    <PackageReference Include="coverlet.collector" Version="6.0.0" />
+  </ItemGroup>
+
+</Project>

+ 27 - 0
TestProject1/UnitTest1.cs

@@ -0,0 +1,27 @@
+namespace TestProject1
+{
+    [TestClass]
+    public class UnitTest1 : PageTest
+    {
+        [TestMethod]
+        public async Task HomepageHasPlaywrightInTitleAndGetStartedLinkLinkingtoTheIntroPage()
+        {
+            await Page.GotoAsync("https://playwright.dev");
+
+            // Expect a title "to contain" a substring.
+            await Expect(Page).ToHaveTitleAsync(new Regex("Playwright"));
+
+            // create a locator
+            var getStarted = Page.Locator("text=Get Started");
+
+            // Expect an attribute "to be strictly equal" to the value.
+            await Expect(getStarted).ToHaveAttributeAsync("href", "/docs/intro");
+
+            // Click the get started link.
+            await getStarted.ClickAsync();
+
+            // Expects the URL to contain intro.
+            await Expect(Page).ToHaveURLAsync(new Regex(".*intro"));
+        }
+    }
+}