From 478ba1f499bed2e0444c929f93600c55c205538b Mon Sep 17 00:00:00 2001 From: MysticBoy Date: Wed, 28 Sep 2022 13:12:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=A9=E9=A1=B9=E7=9B=AE=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=A4=9A=E4=B8=AA=E6=A1=86=E6=9E=B6=20=EF=BC=8CEFCORE?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E6=9D=A1=E4=BB=B6=E4=BD=BF=E7=94=A8.Net=20?= =?UTF-8?q?=E5=86=85=E7=BD=AE=E5=AE=9A=E4=B9=89=E6=9D=A5=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ShardingCore.sln | 416 ++++++++---------- .../ShardingCoreBenchmark5x.csproj | 6 +- .../Sample.SqlServer3x.csproj | 6 +- .../Samples.AbpSharding.csproj | 21 +- .../EntityMetadataDataSourceBuilder.cs | 2 +- .../EntityMetadataTableBuilder.cs | 2 +- .../Core/IShardingModelCacheOption.cs | 2 +- .../Core/VirtualRoutes/TableRouteUnit.cs | 4 +- .../RoutingRuleEngine/TableRouteResult.cs | 4 +- .../ChangeTrackers/ShardingChangeTracker.cs | 8 +- .../EFCore2x/ScriptMigrationGenerator.cs | 2 +- .../EFCores/EFCore2x/ShardingModelSource.cs | 2 +- .../EFCore3x/ScriptMigrationGenerator.cs | 2 +- .../EFCores/EFCore3x/ShardingModelSource.cs | 2 +- .../EFCore5x/ScriptMigrationGenerator.cs | 2 +- .../EFCores/EFCore5x/ShardingModelSource.cs | 2 +- .../EFCore6x/ScriptMigrationGenerator.cs | 2 +- .../EFCores/EFCore6x/ShardingModelSource.cs | 2 +- .../ShardingOptionsExtension.cs | 8 +- .../ShardingWrapOptionsExtension.cs | 8 +- .../UnionAllMergeOptionsExtension.cs | 8 +- .../ShardingRelationalTransaction.cs | 10 +- .../EFCores/ShardingDbSetSource.cs | 8 +- .../EFCores/ShardingInternalDbQuery.cs | 2 +- .../EFCores/ShardingInternalDbSet.cs | 14 +- src/ShardingCore/EFCores/ShardingMigrator.cs | 16 +- .../EFCores/ShardingQueryCompiler.cs | 4 +- .../ShardingRelationalTransactionFactory.cs | 8 +- .../ShardingRelationalTransactionManager.cs | 8 +- .../Extensions/DbContextExtension.cs | 66 +-- .../InternalIEntityTypeExtension.cs | 4 +- src/ShardingCore/Extensions/LinqExtension.cs | 2 +- .../Extensions/ShardingExtension.cs | 4 +- .../StreamMergeEnumerableExtension.cs | 8 +- .../Helpers/MigrationReplaceItem.cs | 4 +- .../Sharding/AbstractShardingDbContext.cs | 14 +- .../Abstractions/IShardingComplierExecutor.cs | 4 +- .../IShardingDbContextExecutor.cs | 4 +- .../Abstractions/IShardingQueryExecutor.cs | 2 +- .../IShardingTrackQueryExecutor.cs | 4 +- .../Abstractions/IShardingTransaction.cs | 2 +- .../ISupportShardingTransaction.cs | 2 +- .../EntityQueryBuilder.cs | 2 +- .../EFCore2TryCurrentAsyncEnumerator.cs | 8 +- ...yGroupByOrderStreamMergeAsyncEnumerator.cs | 12 +- ...MemoryReverseStreamMergeAsyncEnumerator.cs | 4 +- .../InMemoryStreamMergeAsyncEnumerator.cs | 12 +- ...ggregateOrderStreamMergeAsyncEnumerator.cs | 18 +- .../MultiOrderStreamMergeAsyncEnumerator.cs | 10 +- ...AtMostElementStreamMergeAsyncEnumerator.cs | 6 +- .../OrderStreamMergeAsyncEnumerator.cs | 10 +- .../PaginationStreamMergeAsyncEnumerator.cs | 14 +- .../StreamMergeAsyncEnumerator.cs | 4 +- .../AsyncTrackerEnumerable.cs | 4 +- .../AsyncTrackerEnumerator.cs | 4 +- .../MergeContexts/QueryableRewriteEngine.cs | 2 +- .../Enumerables/EmptyQueryEnumerator.cs | 4 +- .../AsyncEnumeratorStreamMergeEngine.cs | 4 +- .../AbstractEnumerableExecutor.cs | 10 +- .../Executors/Methods/SumMethodExecutor.cs | 4 +- .../StreamMerge/AbstractStreamEnumerable.cs | 6 +- .../Visitors/ShardingQueryPrepareVisitor.cs | 6 +- .../DataSourceDbContext.cs | 4 +- .../IDataSourceDbContext.cs | 4 +- .../ShardingDbContextExecutor.cs | 2 +- ...rdingEntityFrameworkQueryableExtensions.cs | 6 +- .../DefaultShardingCompilerExecutor.cs | 4 +- .../DefaultShardingQueryExecutor.cs | 2 +- .../DefaultShardingTrackQueryExecutor.cs | 4 +- .../Sharding/StreamMergeContext.cs | 8 +- .../DbContextReplaceQueryableVisitor.cs | 4 +- .../Visitors/Querys/QueryEntitiesVisitor.cs | 6 +- src/ShardingCore/ShardingCore.csproj | 79 +++- .../ShardingCore.Test2x.csproj | 7 +- .../ShardingCore.Test3x.csproj | 4 +- .../ShardingCore.Test5x.csproj | 2 +- 76 files changed, 499 insertions(+), 482 deletions(-) diff --git a/ShardingCore.sln b/ShardingCore.sln index d2c89ea0..ca7bc3e8 100644 --- a/ShardingCore.sln +++ b/ShardingCore.sln @@ -1,226 +1,190 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31903.59 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{490FAE47-4476-4508-B216-505FC850447F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCore", "src\ShardingCore\ShardingCore.csproj", "{3CAF09A6-6ABD-41D9-BA57-9A822B8095F7}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src3x", "src3x", "{62AAE0FE-4099-4A48-AA3C-F76F14C62655}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCore.3x", "src3x\ShardingCore.3x\ShardingCore.3x.csproj", "{E0FDBFA9-AE5F-42FB-8A60-4E5D9E7D5414}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CC2C88C0-65F2-445D-BE78-973B840FE281}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.SqlServer", "samples\Sample.SqlServer\Sample.SqlServer.csproj", "{D48E5EC2-CF83-4B17-8BBA-BDE52ADFAB1F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AutoByDate.SqlServer", "samples\Samples.AutoByDate.SqlServer\Samples.AutoByDate.SqlServer.csproj", "{C34FCF48-1A98-4268-BFEE-6C9BFC7FD539}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.MySql", "samples\Sample.MySql\Sample.MySql.csproj", "{90675788-D5C3-415A-9C18-FF159A75B4D5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.SqlServer3x", "samples\Sample.SqlServer3x\Sample.SqlServer3x.csproj", "{447D5357-F095-45DE-9DA5-2D9997237366}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AbpSharding", "samples\Samples.AbpSharding\Samples.AbpSharding.csproj", "{1136B8C9-3539-42FA-97FD-CAA6F146FCF0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.BulkConsole", "samples\Sample.BulkConsole\Sample.BulkConsole.csproj", "{2443CC8B-FB7D-47A7-9663-F3848BB30A36}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src2x", "src2x", "{F91949B0-02D5-4E3B-ACF4-AFA6C99A1E04}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCore.2x", "src2x\ShardingCore.2x\ShardingCore.2x.csproj", "{A07C597D-339D-4378-BE4C-A2AF7473340B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.SqlServerShardingDataSource", "samples\Sample.SqlServerShardingDataSource\Sample.SqlServerShardingDataSource.csproj", "{0193E3CF-F2FD-449A-B2D5-7F68E551FDBF}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src5x", "src5x", "{EB1C9149-78C9-4D99-BE3F-B80FE2015E96}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCore.5x", "src5x\ShardingCore.5x\ShardingCore.5x.csproj", "{68A9F118-EF0A-4D03-8845-77D084561A28}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Migrations", "samples\Sample.Migrations\Sample.Migrations.csproj", "{648DCBBE-BE8F-4EAC-8367-FE7BC558DA8C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.SqlServerShardingTable", "samples\Sample.SqlServerShardingTable\Sample.SqlServerShardingTable.csproj", "{88FA5615-1BAA-4021-87EF-9D4A60257FE4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.SqlServerShardingAll", "samples\Sample.SqlServerShardingAll\Sample.SqlServerShardingAll.csproj", "{FD2C6D03-8D6D-4C1C-B534-4C785A4B1B06}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCore.Test5x", "test\ShardingCore.Test5x\ShardingCore.Test5x.csproj", "{59BDEB59-1674-4A71-8F3F-0A690F48ADE6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCore.Test3x", "test\ShardingCore.Test3x\ShardingCore.Test3x.csproj", "{E64E09EF-2DC0-4948-A948-256EF5F95C53}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCore.Test2x", "test\ShardingCore.Test2x\ShardingCore.Test2x.csproj", "{5ED4AF17-F16D-4857-B19C-018831109991}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCore.Test", "test\ShardingCore.Test\ShardingCore.Test.csproj", "{32EA64CC-0877-4B4D-BFBA-504EDB2237D6}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{B458D737-33C5-4C10-9687-0BED2E7CD346}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCoreBenchmark", "benchmarks\ShardingCoreBenchmark\ShardingCoreBenchmark.csproj", "{8CE5E8AF-DDB7-4989-8AA4-1D47E4226846}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCoreBenchmark5x", "benchmarks\ShardingCoreBenchmark5x\ShardingCoreBenchmark5x.csproj", "{ED191305-AB19-4863-A48A-7BA4C21F467B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.NoShardingMultiLevel", "samples\Sample.NoShardingMultiLevel\Sample.NoShardingMultiLevel.csproj", "{DCEBAC86-E62B-4B6C-A352-B8C1C2C6F734}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.MultiConfig", "samples\Sample.MultiConfig\Sample.MultiConfig.csproj", "{D839D632-4AE4-4F75-8A2C-49EE029B0787}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.AutoCreateIfPresent", "samples\Sample.AutoCreateIfPresent\Sample.AutoCreateIfPresent.csproj", "{40C83D48-0614-4651-98C6-2ABBE857D83D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShardingCore.CommonTest", "test\ShardingCore.CommonTest\ShardingCore.CommonTest.csproj", "{3E895438-E609-4860-8391-6897ED55DA06}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.ShardingConsole", "samples\Sample.ShardingConsole\Sample.ShardingConsole.csproj", "{BAB101D4-2BFF-44CE-90E3-8B72DDB266B8}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src6x", "src6x", "{BB80F31B-37F1-44C2-BCFA-F45D1AC765FE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShardingCore.6x", "src6x\ShardingCore.6x\ShardingCore.6x.csproj", "{1FF83CC3-A5F2-45E0-AA39-23C4DDF87D71}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.OracleIssue", "samples\Sample.OracleIssue\Sample.OracleIssue.csproj", "{BF4FEA2A-3F09-47D8-9BF7-4261D8D1671D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3CAF09A6-6ABD-41D9-BA57-9A822B8095F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3CAF09A6-6ABD-41D9-BA57-9A822B8095F7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3CAF09A6-6ABD-41D9-BA57-9A822B8095F7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3CAF09A6-6ABD-41D9-BA57-9A822B8095F7}.Release|Any CPU.Build.0 = Release|Any CPU - {E0FDBFA9-AE5F-42FB-8A60-4E5D9E7D5414}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E0FDBFA9-AE5F-42FB-8A60-4E5D9E7D5414}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E0FDBFA9-AE5F-42FB-8A60-4E5D9E7D5414}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E0FDBFA9-AE5F-42FB-8A60-4E5D9E7D5414}.Release|Any CPU.Build.0 = Release|Any CPU - {D48E5EC2-CF83-4B17-8BBA-BDE52ADFAB1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D48E5EC2-CF83-4B17-8BBA-BDE52ADFAB1F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D48E5EC2-CF83-4B17-8BBA-BDE52ADFAB1F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D48E5EC2-CF83-4B17-8BBA-BDE52ADFAB1F}.Release|Any CPU.Build.0 = Release|Any CPU - {C34FCF48-1A98-4268-BFEE-6C9BFC7FD539}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C34FCF48-1A98-4268-BFEE-6C9BFC7FD539}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C34FCF48-1A98-4268-BFEE-6C9BFC7FD539}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C34FCF48-1A98-4268-BFEE-6C9BFC7FD539}.Release|Any CPU.Build.0 = Release|Any CPU - {90675788-D5C3-415A-9C18-FF159A75B4D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {90675788-D5C3-415A-9C18-FF159A75B4D5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {90675788-D5C3-415A-9C18-FF159A75B4D5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {90675788-D5C3-415A-9C18-FF159A75B4D5}.Release|Any CPU.Build.0 = Release|Any CPU - {447D5357-F095-45DE-9DA5-2D9997237366}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {447D5357-F095-45DE-9DA5-2D9997237366}.Debug|Any CPU.Build.0 = Debug|Any CPU - {447D5357-F095-45DE-9DA5-2D9997237366}.Release|Any CPU.ActiveCfg = Release|Any CPU - {447D5357-F095-45DE-9DA5-2D9997237366}.Release|Any CPU.Build.0 = Release|Any CPU - {1136B8C9-3539-42FA-97FD-CAA6F146FCF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1136B8C9-3539-42FA-97FD-CAA6F146FCF0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1136B8C9-3539-42FA-97FD-CAA6F146FCF0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1136B8C9-3539-42FA-97FD-CAA6F146FCF0}.Release|Any CPU.Build.0 = Release|Any CPU - {2443CC8B-FB7D-47A7-9663-F3848BB30A36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2443CC8B-FB7D-47A7-9663-F3848BB30A36}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2443CC8B-FB7D-47A7-9663-F3848BB30A36}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2443CC8B-FB7D-47A7-9663-F3848BB30A36}.Release|Any CPU.Build.0 = Release|Any CPU - {A07C597D-339D-4378-BE4C-A2AF7473340B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A07C597D-339D-4378-BE4C-A2AF7473340B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A07C597D-339D-4378-BE4C-A2AF7473340B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A07C597D-339D-4378-BE4C-A2AF7473340B}.Release|Any CPU.Build.0 = Release|Any CPU - {0193E3CF-F2FD-449A-B2D5-7F68E551FDBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0193E3CF-F2FD-449A-B2D5-7F68E551FDBF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0193E3CF-F2FD-449A-B2D5-7F68E551FDBF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0193E3CF-F2FD-449A-B2D5-7F68E551FDBF}.Release|Any CPU.Build.0 = Release|Any CPU - {68A9F118-EF0A-4D03-8845-77D084561A28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {68A9F118-EF0A-4D03-8845-77D084561A28}.Debug|Any CPU.Build.0 = Debug|Any CPU - {68A9F118-EF0A-4D03-8845-77D084561A28}.Release|Any CPU.ActiveCfg = Release|Any CPU - {68A9F118-EF0A-4D03-8845-77D084561A28}.Release|Any CPU.Build.0 = Release|Any CPU - {648DCBBE-BE8F-4EAC-8367-FE7BC558DA8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {648DCBBE-BE8F-4EAC-8367-FE7BC558DA8C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {648DCBBE-BE8F-4EAC-8367-FE7BC558DA8C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {648DCBBE-BE8F-4EAC-8367-FE7BC558DA8C}.Release|Any CPU.Build.0 = Release|Any CPU - {88FA5615-1BAA-4021-87EF-9D4A60257FE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88FA5615-1BAA-4021-87EF-9D4A60257FE4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88FA5615-1BAA-4021-87EF-9D4A60257FE4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88FA5615-1BAA-4021-87EF-9D4A60257FE4}.Release|Any CPU.Build.0 = Release|Any CPU - {FD2C6D03-8D6D-4C1C-B534-4C785A4B1B06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FD2C6D03-8D6D-4C1C-B534-4C785A4B1B06}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FD2C6D03-8D6D-4C1C-B534-4C785A4B1B06}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FD2C6D03-8D6D-4C1C-B534-4C785A4B1B06}.Release|Any CPU.Build.0 = Release|Any CPU - {59BDEB59-1674-4A71-8F3F-0A690F48ADE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {59BDEB59-1674-4A71-8F3F-0A690F48ADE6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {59BDEB59-1674-4A71-8F3F-0A690F48ADE6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {59BDEB59-1674-4A71-8F3F-0A690F48ADE6}.Release|Any CPU.Build.0 = Release|Any CPU - {E64E09EF-2DC0-4948-A948-256EF5F95C53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E64E09EF-2DC0-4948-A948-256EF5F95C53}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E64E09EF-2DC0-4948-A948-256EF5F95C53}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E64E09EF-2DC0-4948-A948-256EF5F95C53}.Release|Any CPU.Build.0 = Release|Any CPU - {5ED4AF17-F16D-4857-B19C-018831109991}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5ED4AF17-F16D-4857-B19C-018831109991}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5ED4AF17-F16D-4857-B19C-018831109991}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5ED4AF17-F16D-4857-B19C-018831109991}.Release|Any CPU.Build.0 = Release|Any CPU - {32EA64CC-0877-4B4D-BFBA-504EDB2237D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {32EA64CC-0877-4B4D-BFBA-504EDB2237D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {32EA64CC-0877-4B4D-BFBA-504EDB2237D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {32EA64CC-0877-4B4D-BFBA-504EDB2237D6}.Release|Any CPU.Build.0 = Release|Any CPU - {8CE5E8AF-DDB7-4989-8AA4-1D47E4226846}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8CE5E8AF-DDB7-4989-8AA4-1D47E4226846}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8CE5E8AF-DDB7-4989-8AA4-1D47E4226846}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8CE5E8AF-DDB7-4989-8AA4-1D47E4226846}.Release|Any CPU.Build.0 = Release|Any CPU - {ED191305-AB19-4863-A48A-7BA4C21F467B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ED191305-AB19-4863-A48A-7BA4C21F467B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ED191305-AB19-4863-A48A-7BA4C21F467B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ED191305-AB19-4863-A48A-7BA4C21F467B}.Release|Any CPU.Build.0 = Release|Any CPU - {DCEBAC86-E62B-4B6C-A352-B8C1C2C6F734}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DCEBAC86-E62B-4B6C-A352-B8C1C2C6F734}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DCEBAC86-E62B-4B6C-A352-B8C1C2C6F734}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DCEBAC86-E62B-4B6C-A352-B8C1C2C6F734}.Release|Any CPU.Build.0 = Release|Any CPU - {D839D632-4AE4-4F75-8A2C-49EE029B0787}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D839D632-4AE4-4F75-8A2C-49EE029B0787}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D839D632-4AE4-4F75-8A2C-49EE029B0787}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D839D632-4AE4-4F75-8A2C-49EE029B0787}.Release|Any CPU.Build.0 = Release|Any CPU - {40C83D48-0614-4651-98C6-2ABBE857D83D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {40C83D48-0614-4651-98C6-2ABBE857D83D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {40C83D48-0614-4651-98C6-2ABBE857D83D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {40C83D48-0614-4651-98C6-2ABBE857D83D}.Release|Any CPU.Build.0 = Release|Any CPU - {3E895438-E609-4860-8391-6897ED55DA06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3E895438-E609-4860-8391-6897ED55DA06}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3E895438-E609-4860-8391-6897ED55DA06}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3E895438-E609-4860-8391-6897ED55DA06}.Release|Any CPU.Build.0 = Release|Any CPU - {BAB101D4-2BFF-44CE-90E3-8B72DDB266B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BAB101D4-2BFF-44CE-90E3-8B72DDB266B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BAB101D4-2BFF-44CE-90E3-8B72DDB266B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BAB101D4-2BFF-44CE-90E3-8B72DDB266B8}.Release|Any CPU.Build.0 = Release|Any CPU - {1FF83CC3-A5F2-45E0-AA39-23C4DDF87D71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1FF83CC3-A5F2-45E0-AA39-23C4DDF87D71}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1FF83CC3-A5F2-45E0-AA39-23C4DDF87D71}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1FF83CC3-A5F2-45E0-AA39-23C4DDF87D71}.Release|Any CPU.Build.0 = Release|Any CPU - {BF4FEA2A-3F09-47D8-9BF7-4261D8D1671D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF4FEA2A-3F09-47D8-9BF7-4261D8D1671D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF4FEA2A-3F09-47D8-9BF7-4261D8D1671D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF4FEA2A-3F09-47D8-9BF7-4261D8D1671D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {3CAF09A6-6ABD-41D9-BA57-9A822B8095F7} = {490FAE47-4476-4508-B216-505FC850447F} - {E0FDBFA9-AE5F-42FB-8A60-4E5D9E7D5414} = {62AAE0FE-4099-4A48-AA3C-F76F14C62655} - {D48E5EC2-CF83-4B17-8BBA-BDE52ADFAB1F} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - {C34FCF48-1A98-4268-BFEE-6C9BFC7FD539} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - {90675788-D5C3-415A-9C18-FF159A75B4D5} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - {447D5357-F095-45DE-9DA5-2D9997237366} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - {1136B8C9-3539-42FA-97FD-CAA6F146FCF0} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - {2443CC8B-FB7D-47A7-9663-F3848BB30A36} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - {A07C597D-339D-4378-BE4C-A2AF7473340B} = {F91949B0-02D5-4E3B-ACF4-AFA6C99A1E04} - {0193E3CF-F2FD-449A-B2D5-7F68E551FDBF} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - {68A9F118-EF0A-4D03-8845-77D084561A28} = {EB1C9149-78C9-4D99-BE3F-B80FE2015E96} - {648DCBBE-BE8F-4EAC-8367-FE7BC558DA8C} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - {88FA5615-1BAA-4021-87EF-9D4A60257FE4} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - {FD2C6D03-8D6D-4C1C-B534-4C785A4B1B06} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - {59BDEB59-1674-4A71-8F3F-0A690F48ADE6} = {CC2C88C0-65F2-445D-BE78-973B840FE281} - {E64E09EF-2DC0-4948-A948-256EF5F95C53} = {CC2C88C0-65F2-445D-BE78-973B840FE281} - {5ED4AF17-F16D-4857-B19C-018831109991} = {CC2C88C0-65F2-445D-BE78-973B840FE281} - {32EA64CC-0877-4B4D-BFBA-504EDB2237D6} = {CC2C88C0-65F2-445D-BE78-973B840FE281} - {8CE5E8AF-DDB7-4989-8AA4-1D47E4226846} = {B458D737-33C5-4C10-9687-0BED2E7CD346} - {ED191305-AB19-4863-A48A-7BA4C21F467B} = {B458D737-33C5-4C10-9687-0BED2E7CD346} - {DCEBAC86-E62B-4B6C-A352-B8C1C2C6F734} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - {D839D632-4AE4-4F75-8A2C-49EE029B0787} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - {40C83D48-0614-4651-98C6-2ABBE857D83D} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - {3E895438-E609-4860-8391-6897ED55DA06} = {CC2C88C0-65F2-445D-BE78-973B840FE281} - {BAB101D4-2BFF-44CE-90E3-8B72DDB266B8} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - {1FF83CC3-A5F2-45E0-AA39-23C4DDF87D71} = {BB80F31B-37F1-44C2-BCFA-F45D1AC765FE} - {BF4FEA2A-3F09-47D8-9BF7-4261D8D1671D} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {8C07A667-E8B4-43C7-8053-721584BAD291} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{490FAE47-4476-4508-B216-505FC850447F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCore", "src\ShardingCore\ShardingCore.csproj", "{3CAF09A6-6ABD-41D9-BA57-9A822B8095F7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CC2C88C0-65F2-445D-BE78-973B840FE281}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.SqlServer", "samples\Sample.SqlServer\Sample.SqlServer.csproj", "{D48E5EC2-CF83-4B17-8BBA-BDE52ADFAB1F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AutoByDate.SqlServer", "samples\Samples.AutoByDate.SqlServer\Samples.AutoByDate.SqlServer.csproj", "{C34FCF48-1A98-4268-BFEE-6C9BFC7FD539}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.MySql", "samples\Sample.MySql\Sample.MySql.csproj", "{90675788-D5C3-415A-9C18-FF159A75B4D5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.SqlServer3x", "samples\Sample.SqlServer3x\Sample.SqlServer3x.csproj", "{447D5357-F095-45DE-9DA5-2D9997237366}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AbpSharding", "samples\Samples.AbpSharding\Samples.AbpSharding.csproj", "{1136B8C9-3539-42FA-97FD-CAA6F146FCF0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.BulkConsole", "samples\Sample.BulkConsole\Sample.BulkConsole.csproj", "{2443CC8B-FB7D-47A7-9663-F3848BB30A36}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.SqlServerShardingDataSource", "samples\Sample.SqlServerShardingDataSource\Sample.SqlServerShardingDataSource.csproj", "{0193E3CF-F2FD-449A-B2D5-7F68E551FDBF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Migrations", "samples\Sample.Migrations\Sample.Migrations.csproj", "{648DCBBE-BE8F-4EAC-8367-FE7BC558DA8C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.SqlServerShardingTable", "samples\Sample.SqlServerShardingTable\Sample.SqlServerShardingTable.csproj", "{88FA5615-1BAA-4021-87EF-9D4A60257FE4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.SqlServerShardingAll", "samples\Sample.SqlServerShardingAll\Sample.SqlServerShardingAll.csproj", "{FD2C6D03-8D6D-4C1C-B534-4C785A4B1B06}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCore.Test5x", "test\ShardingCore.Test5x\ShardingCore.Test5x.csproj", "{59BDEB59-1674-4A71-8F3F-0A690F48ADE6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCore.Test3x", "test\ShardingCore.Test3x\ShardingCore.Test3x.csproj", "{E64E09EF-2DC0-4948-A948-256EF5F95C53}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCore.Test2x", "test\ShardingCore.Test2x\ShardingCore.Test2x.csproj", "{5ED4AF17-F16D-4857-B19C-018831109991}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCore.Test", "test\ShardingCore.Test\ShardingCore.Test.csproj", "{32EA64CC-0877-4B4D-BFBA-504EDB2237D6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{B458D737-33C5-4C10-9687-0BED2E7CD346}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCoreBenchmark", "benchmarks\ShardingCoreBenchmark\ShardingCoreBenchmark.csproj", "{8CE5E8AF-DDB7-4989-8AA4-1D47E4226846}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCoreBenchmark5x", "benchmarks\ShardingCoreBenchmark5x\ShardingCoreBenchmark5x.csproj", "{ED191305-AB19-4863-A48A-7BA4C21F467B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.NoShardingMultiLevel", "samples\Sample.NoShardingMultiLevel\Sample.NoShardingMultiLevel.csproj", "{DCEBAC86-E62B-4B6C-A352-B8C1C2C6F734}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.MultiConfig", "samples\Sample.MultiConfig\Sample.MultiConfig.csproj", "{D839D632-4AE4-4F75-8A2C-49EE029B0787}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.AutoCreateIfPresent", "samples\Sample.AutoCreateIfPresent\Sample.AutoCreateIfPresent.csproj", "{40C83D48-0614-4651-98C6-2ABBE857D83D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ShardingCore.CommonTest", "test\ShardingCore.CommonTest\ShardingCore.CommonTest.csproj", "{3E895438-E609-4860-8391-6897ED55DA06}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.ShardingConsole", "samples\Sample.ShardingConsole\Sample.ShardingConsole.csproj", "{BAB101D4-2BFF-44CE-90E3-8B72DDB266B8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.OracleIssue", "samples\Sample.OracleIssue\Sample.OracleIssue.csproj", "{BF4FEA2A-3F09-47D8-9BF7-4261D8D1671D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3CAF09A6-6ABD-41D9-BA57-9A822B8095F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3CAF09A6-6ABD-41D9-BA57-9A822B8095F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3CAF09A6-6ABD-41D9-BA57-9A822B8095F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3CAF09A6-6ABD-41D9-BA57-9A822B8095F7}.Release|Any CPU.Build.0 = Release|Any CPU + {D48E5EC2-CF83-4B17-8BBA-BDE52ADFAB1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D48E5EC2-CF83-4B17-8BBA-BDE52ADFAB1F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D48E5EC2-CF83-4B17-8BBA-BDE52ADFAB1F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D48E5EC2-CF83-4B17-8BBA-BDE52ADFAB1F}.Release|Any CPU.Build.0 = Release|Any CPU + {C34FCF48-1A98-4268-BFEE-6C9BFC7FD539}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C34FCF48-1A98-4268-BFEE-6C9BFC7FD539}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C34FCF48-1A98-4268-BFEE-6C9BFC7FD539}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C34FCF48-1A98-4268-BFEE-6C9BFC7FD539}.Release|Any CPU.Build.0 = Release|Any CPU + {90675788-D5C3-415A-9C18-FF159A75B4D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90675788-D5C3-415A-9C18-FF159A75B4D5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90675788-D5C3-415A-9C18-FF159A75B4D5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {90675788-D5C3-415A-9C18-FF159A75B4D5}.Release|Any CPU.Build.0 = Release|Any CPU + {447D5357-F095-45DE-9DA5-2D9997237366}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {447D5357-F095-45DE-9DA5-2D9997237366}.Debug|Any CPU.Build.0 = Debug|Any CPU + {447D5357-F095-45DE-9DA5-2D9997237366}.Release|Any CPU.ActiveCfg = Release|Any CPU + {447D5357-F095-45DE-9DA5-2D9997237366}.Release|Any CPU.Build.0 = Release|Any CPU + {1136B8C9-3539-42FA-97FD-CAA6F146FCF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1136B8C9-3539-42FA-97FD-CAA6F146FCF0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1136B8C9-3539-42FA-97FD-CAA6F146FCF0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1136B8C9-3539-42FA-97FD-CAA6F146FCF0}.Release|Any CPU.Build.0 = Release|Any CPU + {2443CC8B-FB7D-47A7-9663-F3848BB30A36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2443CC8B-FB7D-47A7-9663-F3848BB30A36}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2443CC8B-FB7D-47A7-9663-F3848BB30A36}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2443CC8B-FB7D-47A7-9663-F3848BB30A36}.Release|Any CPU.Build.0 = Release|Any CPU + {0193E3CF-F2FD-449A-B2D5-7F68E551FDBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0193E3CF-F2FD-449A-B2D5-7F68E551FDBF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0193E3CF-F2FD-449A-B2D5-7F68E551FDBF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0193E3CF-F2FD-449A-B2D5-7F68E551FDBF}.Release|Any CPU.Build.0 = Release|Any CPU + {648DCBBE-BE8F-4EAC-8367-FE7BC558DA8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {648DCBBE-BE8F-4EAC-8367-FE7BC558DA8C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {648DCBBE-BE8F-4EAC-8367-FE7BC558DA8C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {648DCBBE-BE8F-4EAC-8367-FE7BC558DA8C}.Release|Any CPU.Build.0 = Release|Any CPU + {88FA5615-1BAA-4021-87EF-9D4A60257FE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {88FA5615-1BAA-4021-87EF-9D4A60257FE4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {88FA5615-1BAA-4021-87EF-9D4A60257FE4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {88FA5615-1BAA-4021-87EF-9D4A60257FE4}.Release|Any CPU.Build.0 = Release|Any CPU + {FD2C6D03-8D6D-4C1C-B534-4C785A4B1B06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FD2C6D03-8D6D-4C1C-B534-4C785A4B1B06}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FD2C6D03-8D6D-4C1C-B534-4C785A4B1B06}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FD2C6D03-8D6D-4C1C-B534-4C785A4B1B06}.Release|Any CPU.Build.0 = Release|Any CPU + {59BDEB59-1674-4A71-8F3F-0A690F48ADE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59BDEB59-1674-4A71-8F3F-0A690F48ADE6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59BDEB59-1674-4A71-8F3F-0A690F48ADE6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59BDEB59-1674-4A71-8F3F-0A690F48ADE6}.Release|Any CPU.Build.0 = Release|Any CPU + {E64E09EF-2DC0-4948-A948-256EF5F95C53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E64E09EF-2DC0-4948-A948-256EF5F95C53}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E64E09EF-2DC0-4948-A948-256EF5F95C53}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E64E09EF-2DC0-4948-A948-256EF5F95C53}.Release|Any CPU.Build.0 = Release|Any CPU + {5ED4AF17-F16D-4857-B19C-018831109991}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5ED4AF17-F16D-4857-B19C-018831109991}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5ED4AF17-F16D-4857-B19C-018831109991}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5ED4AF17-F16D-4857-B19C-018831109991}.Release|Any CPU.Build.0 = Release|Any CPU + {32EA64CC-0877-4B4D-BFBA-504EDB2237D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {32EA64CC-0877-4B4D-BFBA-504EDB2237D6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {32EA64CC-0877-4B4D-BFBA-504EDB2237D6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {32EA64CC-0877-4B4D-BFBA-504EDB2237D6}.Release|Any CPU.Build.0 = Release|Any CPU + {8CE5E8AF-DDB7-4989-8AA4-1D47E4226846}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8CE5E8AF-DDB7-4989-8AA4-1D47E4226846}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8CE5E8AF-DDB7-4989-8AA4-1D47E4226846}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8CE5E8AF-DDB7-4989-8AA4-1D47E4226846}.Release|Any CPU.Build.0 = Release|Any CPU + {ED191305-AB19-4863-A48A-7BA4C21F467B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ED191305-AB19-4863-A48A-7BA4C21F467B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ED191305-AB19-4863-A48A-7BA4C21F467B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ED191305-AB19-4863-A48A-7BA4C21F467B}.Release|Any CPU.Build.0 = Release|Any CPU + {DCEBAC86-E62B-4B6C-A352-B8C1C2C6F734}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DCEBAC86-E62B-4B6C-A352-B8C1C2C6F734}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DCEBAC86-E62B-4B6C-A352-B8C1C2C6F734}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DCEBAC86-E62B-4B6C-A352-B8C1C2C6F734}.Release|Any CPU.Build.0 = Release|Any CPU + {D839D632-4AE4-4F75-8A2C-49EE029B0787}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D839D632-4AE4-4F75-8A2C-49EE029B0787}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D839D632-4AE4-4F75-8A2C-49EE029B0787}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D839D632-4AE4-4F75-8A2C-49EE029B0787}.Release|Any CPU.Build.0 = Release|Any CPU + {40C83D48-0614-4651-98C6-2ABBE857D83D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {40C83D48-0614-4651-98C6-2ABBE857D83D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {40C83D48-0614-4651-98C6-2ABBE857D83D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {40C83D48-0614-4651-98C6-2ABBE857D83D}.Release|Any CPU.Build.0 = Release|Any CPU + {3E895438-E609-4860-8391-6897ED55DA06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3E895438-E609-4860-8391-6897ED55DA06}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3E895438-E609-4860-8391-6897ED55DA06}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3E895438-E609-4860-8391-6897ED55DA06}.Release|Any CPU.Build.0 = Release|Any CPU + {BAB101D4-2BFF-44CE-90E3-8B72DDB266B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BAB101D4-2BFF-44CE-90E3-8B72DDB266B8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BAB101D4-2BFF-44CE-90E3-8B72DDB266B8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BAB101D4-2BFF-44CE-90E3-8B72DDB266B8}.Release|Any CPU.Build.0 = Release|Any CPU + {BF4FEA2A-3F09-47D8-9BF7-4261D8D1671D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BF4FEA2A-3F09-47D8-9BF7-4261D8D1671D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BF4FEA2A-3F09-47D8-9BF7-4261D8D1671D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BF4FEA2A-3F09-47D8-9BF7-4261D8D1671D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {3CAF09A6-6ABD-41D9-BA57-9A822B8095F7} = {490FAE47-4476-4508-B216-505FC850447F} + {D48E5EC2-CF83-4B17-8BBA-BDE52ADFAB1F} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + {C34FCF48-1A98-4268-BFEE-6C9BFC7FD539} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + {90675788-D5C3-415A-9C18-FF159A75B4D5} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + {447D5357-F095-45DE-9DA5-2D9997237366} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + {1136B8C9-3539-42FA-97FD-CAA6F146FCF0} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + {2443CC8B-FB7D-47A7-9663-F3848BB30A36} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + {0193E3CF-F2FD-449A-B2D5-7F68E551FDBF} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + {648DCBBE-BE8F-4EAC-8367-FE7BC558DA8C} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + {88FA5615-1BAA-4021-87EF-9D4A60257FE4} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + {FD2C6D03-8D6D-4C1C-B534-4C785A4B1B06} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + {59BDEB59-1674-4A71-8F3F-0A690F48ADE6} = {CC2C88C0-65F2-445D-BE78-973B840FE281} + {E64E09EF-2DC0-4948-A948-256EF5F95C53} = {CC2C88C0-65F2-445D-BE78-973B840FE281} + {5ED4AF17-F16D-4857-B19C-018831109991} = {CC2C88C0-65F2-445D-BE78-973B840FE281} + {32EA64CC-0877-4B4D-BFBA-504EDB2237D6} = {CC2C88C0-65F2-445D-BE78-973B840FE281} + {8CE5E8AF-DDB7-4989-8AA4-1D47E4226846} = {B458D737-33C5-4C10-9687-0BED2E7CD346} + {ED191305-AB19-4863-A48A-7BA4C21F467B} = {B458D737-33C5-4C10-9687-0BED2E7CD346} + {DCEBAC86-E62B-4B6C-A352-B8C1C2C6F734} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + {D839D632-4AE4-4F75-8A2C-49EE029B0787} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + {40C83D48-0614-4651-98C6-2ABBE857D83D} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + {3E895438-E609-4860-8391-6897ED55DA06} = {CC2C88C0-65F2-445D-BE78-973B840FE281} + {BAB101D4-2BFF-44CE-90E3-8B72DDB266B8} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + {BF4FEA2A-3F09-47D8-9BF7-4261D8D1671D} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8C07A667-E8B4-43C7-8053-721584BAD291} + EndGlobalSection +EndGlobal diff --git a/benchmarks/ShardingCoreBenchmark5x/ShardingCoreBenchmark5x.csproj b/benchmarks/ShardingCoreBenchmark5x/ShardingCoreBenchmark5x.csproj index 338b7096..197d1354 100644 --- a/benchmarks/ShardingCoreBenchmark5x/ShardingCoreBenchmark5x.csproj +++ b/benchmarks/ShardingCoreBenchmark5x/ShardingCoreBenchmark5x.csproj @@ -1,4 +1,4 @@ - + Exe @@ -11,8 +11,8 @@ - - + + diff --git a/samples/Sample.SqlServer3x/Sample.SqlServer3x.csproj b/samples/Sample.SqlServer3x/Sample.SqlServer3x.csproj index 53c323e9..afba6721 100644 --- a/samples/Sample.SqlServer3x/Sample.SqlServer3x.csproj +++ b/samples/Sample.SqlServer3x/Sample.SqlServer3x.csproj @@ -1,4 +1,4 @@ - + netcoreapp3.1 @@ -8,8 +8,8 @@ - - + + diff --git a/samples/Samples.AbpSharding/Samples.AbpSharding.csproj b/samples/Samples.AbpSharding/Samples.AbpSharding.csproj index 2da6a116..b62ce798 100644 --- a/samples/Samples.AbpSharding/Samples.AbpSharding.csproj +++ b/samples/Samples.AbpSharding/Samples.AbpSharding.csproj @@ -1,16 +1,17 @@ - - net6.0 - + + net6.0 + - - - - + + + + + - - - + + + diff --git a/src/ShardingCore/Core/EntityMetadatas/EntityMetadataDataSourceBuilder.cs b/src/ShardingCore/Core/EntityMetadatas/EntityMetadataDataSourceBuilder.cs index 09289bb3..262b41c6 100644 --- a/src/ShardingCore/Core/EntityMetadatas/EntityMetadataDataSourceBuilder.cs +++ b/src/ShardingCore/Core/EntityMetadatas/EntityMetadataDataSourceBuilder.cs @@ -4,7 +4,7 @@ using System.Linq.Expressions; using System.Text; using Microsoft.EntityFrameworkCore.Infrastructure; -#if EFCORE2 +#if NETCOREAPP2_0 using Microsoft.EntityFrameworkCore.Internal; #endif diff --git a/src/ShardingCore/Core/EntityMetadatas/EntityMetadataTableBuilder.cs b/src/ShardingCore/Core/EntityMetadatas/EntityMetadataTableBuilder.cs index 6c79d482..4806837b 100644 --- a/src/ShardingCore/Core/EntityMetadatas/EntityMetadataTableBuilder.cs +++ b/src/ShardingCore/Core/EntityMetadatas/EntityMetadataTableBuilder.cs @@ -2,7 +2,7 @@ using System.Linq.Expressions; using Microsoft.EntityFrameworkCore.Infrastructure; -#if EFCORE2 +#if NETCOREAPP2_0 using Microsoft.EntityFrameworkCore.Internal; #endif diff --git a/src/ShardingCore/Core/IShardingModelCacheOption.cs b/src/ShardingCore/Core/IShardingModelCacheOption.cs index f3770f55..2e7777d3 100644 --- a/src/ShardingCore/Core/IShardingModelCacheOption.cs +++ b/src/ShardingCore/Core/IShardingModelCacheOption.cs @@ -15,7 +15,7 @@ namespace ShardingCore.Core /// Email: 326308290@qq.com public interface IShardingModelCacheOption { -#if !EFCORE2 +#if !NETCOREAPP2_0 CacheItemPriority GetModelCachePriority(); int GetModelCacheEntrySize(); #endif diff --git a/src/ShardingCore/Core/VirtualRoutes/TableRouteUnit.cs b/src/ShardingCore/Core/VirtualRoutes/TableRouteUnit.cs index d50ce7df..c55d74c2 100644 --- a/src/ShardingCore/Core/VirtualRoutes/TableRouteUnit.cs +++ b/src/ShardingCore/Core/VirtualRoutes/TableRouteUnit.cs @@ -25,7 +25,7 @@ namespace ShardingCore.Core.VirtualRoutes return ReferenceEquals(this, obj) || obj is TableRouteUnit other && Equals(other); } -#if !EFCORE2 +#if !NETCOREAPP2_0 public override int GetHashCode() { @@ -33,7 +33,7 @@ namespace ShardingCore.Core.VirtualRoutes } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public override int GetHashCode() { unchecked diff --git a/src/ShardingCore/Core/VirtualRoutes/TableRoutes/RoutingRuleEngine/TableRouteResult.cs b/src/ShardingCore/Core/VirtualRoutes/TableRoutes/RoutingRuleEngine/TableRouteResult.cs index 03b96f87..e216feeb 100644 --- a/src/ShardingCore/Core/VirtualRoutes/TableRoutes/RoutingRuleEngine/TableRouteResult.cs +++ b/src/ShardingCore/Core/VirtualRoutes/TableRoutes/RoutingRuleEngine/TableRouteResult.cs @@ -47,7 +47,7 @@ namespace ShardingCore.Core.VirtualRoutes.TableRoutes.RoutingRuleEngine return $"(has different tail:{HasDifferentTail},current table:[{string.Join(",", ReplaceTables.Select(o => $"{o.DataSourceName}.{o.Tail}.{o.EntityType}"))}])"; } -#if !EFCORE2 +#if !NETCOREAPP2_0 public override int GetHashCode() { @@ -55,7 +55,7 @@ namespace ShardingCore.Core.VirtualRoutes.TableRoutes.RoutingRuleEngine } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public override int GetHashCode() { diff --git a/src/ShardingCore/EFCores/ChangeTrackers/ShardingChangeTracker.cs b/src/ShardingCore/EFCores/ChangeTrackers/ShardingChangeTracker.cs index 8c96bbc4..01ee4f89 100644 --- a/src/ShardingCore/EFCores/ChangeTrackers/ShardingChangeTracker.cs +++ b/src/ShardingCore/EFCores/ChangeTrackers/ShardingChangeTracker.cs @@ -20,7 +20,7 @@ namespace ShardingCore.EFCores.ChangeTrackers _dbContext = context; } -#if !EFCORE2 && !EFCORE3 && !EFCORE5 && !EFCORE6 +#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0 error #endif @@ -100,7 +100,7 @@ namespace ShardingCore.EFCores.ChangeTrackers } } -#if !EFCORE2 +#if !NETCOREAPP2_0 public override void TrackGraph(object rootEntity, TState state, Func, bool> callback) where TState : default { if (_dbContext is IShardingDbContext shardingDbContext) @@ -122,7 +122,7 @@ namespace ShardingCore.EFCores.ChangeTrackers } #endif -#if !EFCORE2 && !EFCORE3 +#if !NETCOREAPP2_0 && !NETCOREAPP3_0 public override void Clear() { if (_dbContext is ICurrentDbContextDiscover) @@ -134,7 +134,7 @@ namespace ShardingCore.EFCores.ChangeTrackers } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public override void TrackGraph(object rootEntity, TState state, Func callback) { if (_dbContext is IShardingDbContext shardingDbContext) diff --git a/src/ShardingCore/EFCores/EFCore2x/ScriptMigrationGenerator.cs b/src/ShardingCore/EFCores/EFCore2x/ScriptMigrationGenerator.cs index e208f033..e6c836c5 100644 --- a/src/ShardingCore/EFCores/EFCore2x/ScriptMigrationGenerator.cs +++ b/src/ShardingCore/EFCores/EFCore2x/ScriptMigrationGenerator.cs @@ -1,4 +1,4 @@ -#if EFCORE2 +#if NETCOREAPP2_0 using Microsoft.EntityFrameworkCore.Migrations; using ShardingCore.Core.RuntimeContexts; diff --git a/src/ShardingCore/EFCores/EFCore2x/ShardingModelSource.cs b/src/ShardingCore/EFCores/EFCore2x/ShardingModelSource.cs index b35699ff..f9999e26 100644 --- a/src/ShardingCore/EFCores/EFCore2x/ShardingModelSource.cs +++ b/src/ShardingCore/EFCores/EFCore2x/ShardingModelSource.cs @@ -1,4 +1,4 @@ -#if EFCORE2 +#if NETCOREAPP2_0 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; diff --git a/src/ShardingCore/EFCores/EFCore3x/ScriptMigrationGenerator.cs b/src/ShardingCore/EFCores/EFCore3x/ScriptMigrationGenerator.cs index 3ff2b427..ead0c994 100644 --- a/src/ShardingCore/EFCores/EFCore3x/ScriptMigrationGenerator.cs +++ b/src/ShardingCore/EFCores/EFCore3x/ScriptMigrationGenerator.cs @@ -1,4 +1,4 @@ -#if EFCORE3 +#if NETCOREAPP3_0 using Microsoft.EntityFrameworkCore.Migrations; using ShardingCore.Core.RuntimeContexts; diff --git a/src/ShardingCore/EFCores/EFCore3x/ShardingModelSource.cs b/src/ShardingCore/EFCores/EFCore3x/ShardingModelSource.cs index bb3548e0..df86c1f0 100644 --- a/src/ShardingCore/EFCores/EFCore3x/ShardingModelSource.cs +++ b/src/ShardingCore/EFCores/EFCore3x/ShardingModelSource.cs @@ -1,4 +1,4 @@ -#if EFCORE3 +#if NETCOREAPP3_0 using System; using System.Collections.Generic; using System.Linq; diff --git a/src/ShardingCore/EFCores/EFCore5x/ScriptMigrationGenerator.cs b/src/ShardingCore/EFCores/EFCore5x/ScriptMigrationGenerator.cs index 8dd16a21..1465d9d5 100644 --- a/src/ShardingCore/EFCores/EFCore5x/ScriptMigrationGenerator.cs +++ b/src/ShardingCore/EFCores/EFCore5x/ScriptMigrationGenerator.cs @@ -1,4 +1,4 @@ -#if EFCORE5 +#if NET5_0 using Microsoft.EntityFrameworkCore.Migrations; using ShardingCore.Core.RuntimeContexts; diff --git a/src/ShardingCore/EFCores/EFCore5x/ShardingModelSource.cs b/src/ShardingCore/EFCores/EFCore5x/ShardingModelSource.cs index 1503c3a1..c304d61b 100644 --- a/src/ShardingCore/EFCores/EFCore5x/ShardingModelSource.cs +++ b/src/ShardingCore/EFCores/EFCore5x/ShardingModelSource.cs @@ -1,4 +1,4 @@ -#if EFCORE5 +#if NET5_0 using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/src/ShardingCore/EFCores/EFCore6x/ScriptMigrationGenerator.cs b/src/ShardingCore/EFCores/EFCore6x/ScriptMigrationGenerator.cs index ef7d1ae5..3f556d01 100644 --- a/src/ShardingCore/EFCores/EFCore6x/ScriptMigrationGenerator.cs +++ b/src/ShardingCore/EFCores/EFCore6x/ScriptMigrationGenerator.cs @@ -1,4 +1,4 @@ -#if EFCORE6 +#if NET6_0 using Microsoft.EntityFrameworkCore.Migrations; using ShardingCore.Core.RuntimeContexts; diff --git a/src/ShardingCore/EFCores/EFCore6x/ShardingModelSource.cs b/src/ShardingCore/EFCores/EFCore6x/ShardingModelSource.cs index 15663752..85173623 100644 --- a/src/ShardingCore/EFCores/EFCore6x/ShardingModelSource.cs +++ b/src/ShardingCore/EFCores/EFCore6x/ShardingModelSource.cs @@ -1,5 +1,5 @@  -#if EFCORE6 +#if NET6_0 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; diff --git a/src/ShardingCore/EFCores/OptionsExtensions/ShardingOptionsExtension.cs b/src/ShardingCore/EFCores/OptionsExtensions/ShardingOptionsExtension.cs index cb75b163..97442ae6 100644 --- a/src/ShardingCore/EFCores/OptionsExtensions/ShardingOptionsExtension.cs +++ b/src/ShardingCore/EFCores/OptionsExtensions/ShardingOptionsExtension.cs @@ -14,11 +14,11 @@ namespace ShardingCore.EFCores.OptionsExtensions * @Ver: 1.0 * @Email: 326308290@qq.com */ -#if !EFCORE2 && !EFCORE3 && !EFCORE5 && !EFCORE6 +#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0 error #endif -#if EFCORE6 +#if NET6_0 public class ShardingOptionsExtension : IDbContextOptionsExtension { public IShardingRuntimeContext ShardingRuntimeContext { get; } @@ -63,7 +63,7 @@ namespace ShardingCore.EFCores.OptionsExtensions } } #endif -#if EFCORE3 || EFCORE5 +#if NETCOREAPP3_0 || NET5_0 public class ShardingOptionsExtension: IDbContextOptionsExtension { public IShardingRuntimeContext ShardingRuntimeContext { get; } @@ -103,7 +103,7 @@ namespace ShardingCore.EFCores.OptionsExtensions } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public class ShardingOptionsExtension: IDbContextOptionsExtension { public IShardingRuntimeContext ShardingRuntimeContext { get; } diff --git a/src/ShardingCore/EFCores/OptionsExtensions/ShardingWrapOptionsExtension.cs b/src/ShardingCore/EFCores/OptionsExtensions/ShardingWrapOptionsExtension.cs index 0e381c41..1d1e50d6 100644 --- a/src/ShardingCore/EFCores/OptionsExtensions/ShardingWrapOptionsExtension.cs +++ b/src/ShardingCore/EFCores/OptionsExtensions/ShardingWrapOptionsExtension.cs @@ -15,10 +15,10 @@ namespace ShardingCore.EFCores.OptionsExtensions * @Email: 326308290@qq.com */ -#if !EFCORE2 && !EFCORE3 && !EFCORE5 && !EFCORE6 +#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0 error #endif -#if EFCORE6 +#if NET6_0 public class ShardingWrapOptionsExtension : IDbContextOptionsExtension { @@ -55,7 +55,7 @@ namespace ShardingCore.EFCores.OptionsExtensions } } #endif -#if EFCORE3 || EFCORE5 +#if NETCOREAPP3_0 || NET5_0 public class ShardingWrapOptionsExtension: IDbContextOptionsExtension { @@ -84,7 +84,7 @@ namespace ShardingCore.EFCores.OptionsExtensions } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public class ShardingWrapOptionsExtension: IDbContextOptionsExtension { diff --git a/src/ShardingCore/EFCores/OptionsExtensions/UnionAllMergeOptionsExtension.cs b/src/ShardingCore/EFCores/OptionsExtensions/UnionAllMergeOptionsExtension.cs index e55f93f7..d58d3bc4 100644 --- a/src/ShardingCore/EFCores/OptionsExtensions/UnionAllMergeOptionsExtension.cs +++ b/src/ShardingCore/EFCores/OptionsExtensions/UnionAllMergeOptionsExtension.cs @@ -14,10 +14,10 @@ namespace ShardingCore.EFCores.OptionsExtensions * @Email: 326308290@qq.com */ -#if !EFCORE2 && !EFCORE3 && !EFCORE5 && !EFCORE6 +#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0 error #endif -#if EFCORE6 +#if NET6_0 public class UnionAllMergeOptionsExtension : IDbContextOptionsExtension { public void ApplyServices(IServiceCollection services) @@ -50,7 +50,7 @@ namespace ShardingCore.EFCores.OptionsExtensions } } #endif -#if EFCORE3 || EFCORE5 +#if NETCOREAPP3_0 || NET5_0 public class UnionAllMergeOptionsExtension: IDbContextOptionsExtension { @@ -79,7 +79,7 @@ namespace ShardingCore.EFCores.OptionsExtensions } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public class UnionAllMergeOptionsExtension: IDbContextOptionsExtension { diff --git a/src/ShardingCore/EFCores/RelationTransactions/ShardingRelationalTransaction.cs b/src/ShardingCore/EFCores/RelationTransactions/ShardingRelationalTransaction.cs index 3ceedf6f..0f9ad2d8 100644 --- a/src/ShardingCore/EFCores/RelationTransactions/ShardingRelationalTransaction.cs +++ b/src/ShardingCore/EFCores/RelationTransactions/ShardingRelationalTransaction.cs @@ -20,27 +20,27 @@ namespace ShardingCore.EFCores * @Ver: 1.0 * @Email: 326308290@qq.com */ -#if !EFCORE2 && !EFCORE3 && !EFCORE5 && !EFCORE6 +#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0 error #endif public class ShardingRelationalTransaction : RelationalTransaction { private readonly IShardingDbContext _shardingDbContext; -#if EFCORE6 +#if NET6_0 public ShardingRelationalTransaction(IShardingDbContext shardingDbContext, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, IDiagnosticsLogger logger, bool transactionOwned, ISqlGenerationHelper sqlGenerationHelper) : base(connection, transaction, transactionId, logger, transactionOwned, sqlGenerationHelper) { _shardingDbContext = shardingDbContext ?? throw new ShardingCoreInvalidOperationException($"should implement {nameof(IShardingDbContext)}"); } #endif -#if EFCORE3 || EFCORE5 +#if NETCOREAPP3_0 || NET5_0 public ShardingRelationalTransaction(IShardingDbContext shardingDbContext, IRelationalConnection connection, DbTransaction transaction, Guid transactionId, IDiagnosticsLogger logger, bool transactionOwned) : base(connection, transaction, transactionId, logger, transactionOwned) { _shardingDbContext = shardingDbContext??throw new ShardingCoreInvalidOperationException($"should implement {nameof(IShardingDbContext)}"); } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public ShardingRelationalTransaction(IShardingDbContext shardingDbContext, IRelationalConnection connection, DbTransaction transaction,IDiagnosticsLogger logger, bool transactionOwned) : base(connection, transaction, logger, transactionOwned) { _shardingDbContext = shardingDbContext??throw new ShardingCoreInvalidOperationException($"should implement {nameof(IShardingDbContext)}"); @@ -71,7 +71,7 @@ namespace ShardingCore.EFCores _shardingDbContext.NotifyShardingTransaction(); } -#if !EFCORE2 +#if !NETCOREAPP2_0 public override async Task RollbackAsync(CancellationToken cancellationToken = new CancellationToken()) { diff --git a/src/ShardingCore/EFCores/ShardingDbSetSource.cs b/src/ShardingCore/EFCores/ShardingDbSetSource.cs index 6210bd71..230fb018 100644 --- a/src/ShardingCore/EFCores/ShardingDbSetSource.cs +++ b/src/ShardingCore/EFCores/ShardingDbSetSource.cs @@ -12,10 +12,10 @@ namespace ShardingCore.EFCores * @Date: Saturday, 14 August 2021 10:17:43 * @Email: 326308290@qq.com */ -#if !EFCORE2 && !EFCORE3 && !EFCORE5 && !EFCORE6 +#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0 error #endif -#if EFCORE5 || EFCORE6 +#if NET5_0 || NET6_0 public class ShardingDbSetSource : IDbSetSource { @@ -55,7 +55,7 @@ namespace ShardingCore.EFCores => (c, name) => new ShardingInternalDbSet(c, name); } #endif -#if EFCORE3 +#if NETCOREAPP3_0 public class ShardingDbSetSource:IDbSetSource { @@ -87,7 +87,7 @@ namespace ShardingCore.EFCores } #endif -#if EFCORE2 +#if NETCOREAPP2_0 /// /// This API supports the Entity Framework Core infrastructure and is not intended to be used diff --git a/src/ShardingCore/EFCores/ShardingInternalDbQuery.cs b/src/ShardingCore/EFCores/ShardingInternalDbQuery.cs index c6481315..ec5cb4b7 100644 --- a/src/ShardingCore/EFCores/ShardingInternalDbQuery.cs +++ b/src/ShardingCore/EFCores/ShardingInternalDbQuery.cs @@ -13,7 +13,7 @@ namespace ShardingCore.EFCores * @Ver: 1.0 * @Email: 326308290@qq.com */ -#if EFCORE2 +#if NETCOREAPP2_0 public class ShardingInternalDbQuery : InternalDbQuery where TQuery : class { diff --git a/src/ShardingCore/EFCores/ShardingInternalDbSet.cs b/src/ShardingCore/EFCores/ShardingInternalDbSet.cs index df4b914e..32d35230 100644 --- a/src/ShardingCore/EFCores/ShardingInternalDbSet.cs +++ b/src/ShardingCore/EFCores/ShardingInternalDbSet.cs @@ -26,7 +26,7 @@ namespace ShardingCore.EFCores * @Email: 326308290@qq.com */ -#if !EFCORE2 && !EFCORE3 && !EFCORE5 && !EFCORE6 +#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0 error #endif public class ShardingInternalDbSet : InternalDbSet @@ -36,7 +36,7 @@ namespace ShardingCore.EFCores private readonly IShardingRuntimeContext _shardingRuntimeContext; private LocalView? _localView; -#if EFCORE5 || EFCORE6 +#if NET5_0 || NET6_0 public ShardingInternalDbSet(DbContext context, string entityTypeName) : base(context, entityTypeName) { @@ -44,7 +44,7 @@ namespace ShardingCore.EFCores _shardingRuntimeContext = context.GetShardingRuntimeContext(); } #endif -#if EFCORE2 || EFCORE3 +#if NETCOREAPP2_0 || NETCOREAPP3_0 public ShardingInternalDbSet(DbContext context) : base(context) { _context = (IShardingDbContext)context; @@ -128,7 +128,7 @@ namespace ShardingCore.EFCores /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// -#if !EFCORE2 +#if !NETCOREAPP2_0 public override async ValueTask> AddAsync( TEntity entity, CancellationToken cancellationToken = default) @@ -137,7 +137,7 @@ namespace ShardingCore.EFCores return await genericDbContext.Set().AddAsync(entity, cancellationToken); } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public override async Task> AddAsync(TEntity entity, CancellationToken cancellationToken = new CancellationToken()) { @@ -365,7 +365,7 @@ namespace ShardingCore.EFCores return base.Find(keyValues); } -#if !EFCORE2 +#if !NETCOREAPP2_0 public override ValueTask FindAsync(params object[] keyValues) { var primaryKeyFindDbContext = GetDbContextByKeyValue(keyValues); @@ -388,7 +388,7 @@ namespace ShardingCore.EFCores return base.FindAsync(keyValues, cancellationToken); } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public override Task FindAsync(params object[] keyValues) { var primaryKeyFindDbContext = GetDbContextByKeyValue(keyValues); diff --git a/src/ShardingCore/EFCores/ShardingMigrator.cs b/src/ShardingCore/EFCores/ShardingMigrator.cs index 5c4994da..db3fc6f4 100644 --- a/src/ShardingCore/EFCores/ShardingMigrator.cs +++ b/src/ShardingCore/EFCores/ShardingMigrator.cs @@ -24,7 +24,7 @@ using ShardingCore.Helpers; using ShardingCore.Sharding.Abstractions; using ShardingCore.Sharding.ShardingDbContextExecutors; -#if !EFCORE2 +#if !NETCOREAPP2_0 using Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure; #endif @@ -35,32 +35,32 @@ namespace ShardingCore.EFCores { private readonly IShardingRuntimeContext _shardingRuntimeContext; -#if !EFCORE2 && !EFCORE3 && !EFCORE5 && !EFCORE6 +#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0 error #endif -#if EFCORE6 +#if NET6_0 public ShardingMigrator(IShardingRuntimeContext shardingRuntimeContext,IMigrationsAssembly migrationsAssembly, IHistoryRepository historyRepository, IDatabaseCreator databaseCreator, IMigrationsSqlGenerator migrationsSqlGenerator, IRawSqlCommandBuilder rawSqlCommandBuilder, IMigrationCommandExecutor migrationCommandExecutor, IRelationalConnection connection, ISqlGenerationHelper sqlGenerationHelper, ICurrentDbContext currentContext, IModelRuntimeInitializer modelRuntimeInitializer, IDiagnosticsLogger logger, IRelationalCommandDiagnosticsLogger commandLogger, IDatabaseProvider databaseProvider) : base(migrationsAssembly, historyRepository, databaseCreator, migrationsSqlGenerator, rawSqlCommandBuilder, migrationCommandExecutor, connection, sqlGenerationHelper, currentContext, modelRuntimeInitializer, logger, commandLogger, databaseProvider) { _shardingRuntimeContext = shardingRuntimeContext; } #endif -#if EFCORE5 +#if NET5_0 public ShardingMigrator(IShardingRuntimeContext shardingRuntimeContext, IMigrationsAssembly migrationsAssembly, IHistoryRepository historyRepository, IDatabaseCreator databaseCreator, IMigrationsSqlGenerator migrationsSqlGenerator, IRawSqlCommandBuilder rawSqlCommandBuilder, IMigrationCommandExecutor migrationCommandExecutor, IRelationalConnection connection, ISqlGenerationHelper sqlGenerationHelper, ICurrentDbContext currentContext, IConventionSetBuilder conventionSetBuilder, IDiagnosticsLogger logger, IDiagnosticsLogger commandLogger, IDatabaseProvider databaseProvider) : base(migrationsAssembly, historyRepository, databaseCreator, migrationsSqlGenerator, rawSqlCommandBuilder, migrationCommandExecutor, connection, sqlGenerationHelper, currentContext, conventionSetBuilder, logger, commandLogger, databaseProvider) { _shardingRuntimeContext = shardingRuntimeContext; } #endif -#if EFCORE3 +#if NETCOREAPP3_0 public ShardingMigrator(IShardingRuntimeContext shardingRuntimeContext, IMigrationsAssembly migrationsAssembly, IHistoryRepository historyRepository, IDatabaseCreator databaseCreator, IMigrationsSqlGenerator migrationsSqlGenerator, IRawSqlCommandBuilder rawSqlCommandBuilder, IMigrationCommandExecutor migrationCommandExecutor, IRelationalConnection connection, ISqlGenerationHelper sqlGenerationHelper, ICurrentDbContext currentContext, IDiagnosticsLogger logger, IDiagnosticsLogger commandLogger, IDatabaseProvider databaseProvider) : base(migrationsAssembly, historyRepository, databaseCreator, migrationsSqlGenerator, rawSqlCommandBuilder, migrationCommandExecutor, connection, sqlGenerationHelper, currentContext, logger, commandLogger, databaseProvider) { _shardingRuntimeContext = shardingRuntimeContext; } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public ShardingMigrator(IShardingRuntimeContext shardingRuntimeContext, IMigrationsAssembly migrationsAssembly, IHistoryRepository historyRepository, IDatabaseCreator databaseCreator, IMigrationsSqlGenerator migrationsSqlGenerator, IRawSqlCommandBuilder rawSqlCommandBuilder, IMigrationCommandExecutor migrationCommandExecutor, IRelationalConnection connection, ISqlGenerationHelper sqlGenerationHelper, IDiagnosticsLogger logger, IDatabaseProvider databaseProvider) : base(migrationsAssembly, historyRepository, databaseCreator, migrationsSqlGenerator, rawSqlCommandBuilder, migrationCommandExecutor, connection, sqlGenerationHelper, logger, databaseProvider) { @@ -81,7 +81,7 @@ namespace ShardingCore.EFCores await DynamicShardingHelper.DynamicMigrateWithDataSourcesAsync(_shardingRuntimeContext, allDataSourceNames, null,cancellationToken); } -#if EFCORE6 || EFCORE5 +#if NET6_0 || NET5_0 public override string GenerateScript(string fromMigration = null, string toMigration = null, MigrationsSqlGenerationOptions options = MigrationsSqlGenerationOptions.Default) @@ -89,7 +89,7 @@ namespace ShardingCore.EFCores return new ScriptMigrationGenerator(_shardingRuntimeContext, fromMigration, toMigration, options).GenerateScript(); } #endif -#if EFCORE3 || EFCORE2 +#if NETCOREAPP3_0 || NETCOREAPP2_0 public override string GenerateScript(string fromMigration = null, string toMigration = null, bool idempotent = false) { return new ScriptMigrationGenerator(_shardingRuntimeContext, fromMigration, toMigration, idempotent).GenerateScript(); diff --git a/src/ShardingCore/EFCores/ShardingQueryCompiler.cs b/src/ShardingCore/EFCores/ShardingQueryCompiler.cs index abfacb80..2a4b480d 100644 --- a/src/ShardingCore/EFCores/ShardingQueryCompiler.cs +++ b/src/ShardingCore/EFCores/ShardingQueryCompiler.cs @@ -38,7 +38,7 @@ namespace ShardingCore.EFCores } -#if !EFCORE2 +#if !NETCOREAPP2_0 public TResult ExecuteAsync(Expression query, CancellationToken cancellationToken) { @@ -59,7 +59,7 @@ namespace ShardingCore.EFCores #endif -#if EFCORE2 +#if NETCOREAPP2_0 public IAsyncEnumerable ExecuteAsync(Expression query) { return _shardingCompilerExecutor.ExecuteAsync(_shardingDbContext, query); diff --git a/src/ShardingCore/EFCores/ShardingRelationalTransactionFactory.cs b/src/ShardingCore/EFCores/ShardingRelationalTransactionFactory.cs index 6a3db17e..cce5d38f 100644 --- a/src/ShardingCore/EFCores/ShardingRelationalTransactionFactory.cs +++ b/src/ShardingCore/EFCores/ShardingRelationalTransactionFactory.cs @@ -18,10 +18,10 @@ namespace ShardingCore.EFCores * @Ver: 1.0 * @Email: 326308290@qq.com */ -#if !EFCORE2 && !EFCORE3 && !EFCORE5 && !EFCORE6 +#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0 error #endif -#if EFCORE6 +#if NET6_0 public class ShardingRelationalTransactionFactory : RelationalTransactionFactory where TShardingDbContext : DbContext, IShardingDbContext { @@ -38,7 +38,7 @@ namespace ShardingCore.EFCores } } #endif -#if EFCORE3 || EFCORE5 +#if NETCOREAPP3_0 || NET5_0 public class ShardingRelationalTransactionFactory : RelationalTransactionFactory where TShardingDbContext : DbContext, IShardingDbContext { @@ -55,7 +55,7 @@ namespace ShardingCore.EFCores } } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public class ShardingRelationalTransactionFactory : RelationalTransactionFactory where TShardingDbContext : DbContext, IShardingDbContext { diff --git a/src/ShardingCore/EFCores/ShardingRelationalTransactionManager.cs b/src/ShardingCore/EFCores/ShardingRelationalTransactionManager.cs index 75f0b6e4..b6bcdf31 100644 --- a/src/ShardingCore/EFCores/ShardingRelationalTransactionManager.cs +++ b/src/ShardingCore/EFCores/ShardingRelationalTransactionManager.cs @@ -27,7 +27,7 @@ namespace ShardingCore.EFCores { private readonly IRelationalConnection _relationalConnection; private readonly IShardingDbContext _shardingDbContext; -#if !EFCORE2 +#if !NETCOREAPP2_0 public ShardingRelationalTransactionManager(IRelationalConnection relationalConnection) { _relationalConnection = relationalConnection; @@ -35,7 +35,7 @@ namespace ShardingCore.EFCores } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public ShardingRelationalTransactionManager(IRelationalConnection relationalConnection) { _relationalConnection = relationalConnection; @@ -99,7 +99,7 @@ namespace ShardingCore.EFCores _shardingDbContext.NotifyShardingTransaction(); return dbContextTransaction; } -#if !EFCORE2 +#if !NETCOREAPP2_0 public Task ResetStateAsync(CancellationToken cancellationToken = new CancellationToken()) { @@ -112,7 +112,7 @@ namespace ShardingCore.EFCores _shardingDbContext.NotifyShardingTransaction(); return dbContextTransaction; } -#if !EFCORE3 +#if !NETCOREAPP3_0 public Task CommitTransactionAsync(CancellationToken cancellationToken = new CancellationToken()) { diff --git a/src/ShardingCore/Extensions/DbContextExtension.cs b/src/ShardingCore/Extensions/DbContextExtension.cs index 5eb449cb..fc74d586 100644 --- a/src/ShardingCore/Extensions/DbContextExtension.cs +++ b/src/ShardingCore/Extensions/DbContextExtension.cs @@ -32,21 +32,21 @@ namespace ShardingCore.Extensions /// public static void RemoveDbContextRelationModelThatIsShardingTable(this DbContext dbContext) { -#if !EFCORE2&&!EFCORE3&&!EFCORE5&&!EFCORE6 +#if !NETCOREAPP2_0&&!NETCOREAPP3_0&&!NET5_0&&!NET6_0 throw new NotImplementedException(); #endif -#if EFCORE6 +#if NET6_0 var contextModel = dbContext.GetService().Model; ; #endif -#if EFCORE2 || EFCORE3 || EFCORE5 +#if NETCOREAPP2_0 || NETCOREAPP3_0 || NET5_0 var contextModel = dbContext.Model as Model; #endif var shardingRuntimeContext = dbContext.GetShardingRuntimeContext(); var entityMetadataManager = shardingRuntimeContext.GetEntityMetadataManager(); -#if EFCORE6 +#if NET6_0 var contextModelRelationalModel = contextModel.GetRelationalModel() as RelationalModel; var valueTuples = contextModelRelationalModel.Tables.Where(o =>o.Value.EntityTypeMappings.Any(m => entityMetadataManager.IsShardingTable(m.EntityType.ClrType))).Select(o => o.Key).ToList(); @@ -55,7 +55,7 @@ namespace ShardingCore.Extensions contextModelRelationalModel.Tables.Remove(valueTuples[i]); } #endif -#if EFCORE5 +#if NET5_0 var contextModelRelationalModel = contextModel.RelationalModel as RelationalModel; var valueTuples = contextModelRelationalModel.Tables.Where(o => o.Value.EntityTypeMappings.Any(m => entityMetadataManager.IsShardingTable(m.EntityType.ClrType))).Select(o => o.Key).ToList(); @@ -64,7 +64,7 @@ namespace ShardingCore.Extensions contextModelRelationalModel.Tables.Remove(valueTuples[i]); } #endif -#if EFCORE2 || EFCORE3 +#if NETCOREAPP2_0 || NETCOREAPP3_0 var entityTypes = contextModel.GetFieldValue("_entityTypes") as SortedDictionary; var list = entityTypes.Where(o=>entityMetadataManager.IsShardingTable(o.Value.ClrType)).Select(o=>o.Key).ToList(); @@ -81,23 +81,23 @@ namespace ShardingCore.Extensions // /// // public static void RemoveDbContextAllRelationModel(this DbContext dbContext) // { - //#if EFCORE6 + //#if NET6_0 // var contextModel = dbContext.GetService().Model; ; //#endif - //#if EFCORE2 || EFCORE3 || EFCORE5 + //#if NETCOREAPP2_0 || NETCOREAPP3_0 || NET5_0 // var contextModel = dbContext.Model as Model; //#endif - //#if EFCORE6 + //#if NET6_0 // var contextModelRelationalModel = contextModel.GetRelationalModel() as RelationalModel; // contextModelRelationalModel.Tables.Clear(); //#endif - //#if EFCORE5 + //#if NET5_0 // var contextModelRelationalModel = contextModel.RelationalModel as RelationalModel; // contextModelRelationalModel.Tables.Clear(); //#endif - //#if EFCORE2 || EFCORE3 + //#if NETCOREAPP2_0 || NETCOREAPP3_0 // var entityTypes = // contextModel.GetFieldValue("_entityTypes") as SortedDictionary; // entityTypes.Clear(); @@ -109,21 +109,21 @@ namespace ShardingCore.Extensions /// public static void RemoveDbContextAllRelationModelWithoutShardingDataSourceOnly(this DbContext dbContext) { -#if !EFCORE2&&!EFCORE3&&!EFCORE5&&!EFCORE6 +#if !NETCOREAPP2_0&&!NETCOREAPP3_0&&!NET5_0&&!NET6_0 throw new NotImplementedException(); #endif -#if EFCORE6 +#if NET6_0 var contextModel = dbContext.GetService().Model; ; #endif -#if EFCORE2 || EFCORE3 || EFCORE5 +#if NETCOREAPP2_0 || NETCOREAPP3_0 || NET5_0 var contextModel = dbContext.Model as Model; #endif var shardingRuntimeContext = dbContext.GetShardingRuntimeContext(); var entityMetadataManager = shardingRuntimeContext.GetEntityMetadataManager(); -#if EFCORE6 +#if NET6_0 var contextModelRelationalModel = contextModel.GetRelationalModel() as RelationalModel; var valueTuples = contextModelRelationalModel.Tables.Where(o => o.Value.EntityTypeMappings.Any(m => !entityMetadataManager.IsShardingDataSource(m.EntityType.ClrType) ||entityMetadataManager.TryGet(m.EntityType.ClrType)==null)).Select(o => o.Key).ToList(); @@ -132,7 +132,7 @@ namespace ShardingCore.Extensions contextModelRelationalModel.Tables.Remove(valueTuples[i]); } #endif -#if EFCORE5 +#if NET5_0 var contextModelRelationalModel = contextModel.RelationalModel as RelationalModel; var valueTuples = contextModelRelationalModel.Tables.Where(o => o.Value.EntityTypeMappings.Any(m => !entityMetadataManager.IsShardingDataSource(m.EntityType.ClrType)||entityMetadataManager.TryGet(m.EntityType.ClrType)==null)).Select(o => o.Key).ToList(); @@ -141,7 +141,7 @@ namespace ShardingCore.Extensions contextModelRelationalModel.Tables.Remove(valueTuples[i]); } #endif -#if EFCORE2 || EFCORE3 +#if NETCOREAPP2_0 || NETCOREAPP3_0 var entityTypes = contextModel.GetFieldValue("_entityTypes") as SortedDictionary; var list = entityTypes.Where(o => !entityMetadataManager.IsShardingDataSource(o.Value.ClrType) || entityMetadataManager.TryGet(o.Value.ClrType) == null).Select(o => o.Key).ToList(); @@ -157,27 +157,27 @@ namespace ShardingCore.Extensions /// public static void RemoveDbContextAllRelationModel(this DbContext dbContext) { -#if !EFCORE2&&!EFCORE3&&!EFCORE5&&!EFCORE6 +#if !NETCOREAPP2_0&&!NETCOREAPP3_0&&!NET5_0&&!NET6_0 throw new NotImplementedException(); #endif -#if EFCORE6 +#if NET6_0 var contextModel = dbContext.GetService().Model; ; #endif -#if EFCORE2 || EFCORE3 || EFCORE5 +#if NETCOREAPP2_0 || NETCOREAPP3_0 || NET5_0 var contextModel = dbContext.Model as Model; #endif -#if EFCORE6 +#if NET6_0 var contextModelRelationalModel = contextModel.GetRelationalModel() as RelationalModel; contextModelRelationalModel.Tables.Clear(); #endif -#if EFCORE5 +#if NET5_0 var contextModelRelationalModel = contextModel.RelationalModel as RelationalModel; contextModelRelationalModel.Tables.Clear(); #endif -#if EFCORE2 || EFCORE3 +#if NETCOREAPP2_0 || NETCOREAPP3_0 var entityTypes = contextModel.GetFieldValue("_entityTypes") as SortedDictionary; entityTypes.Clear(); @@ -192,14 +192,14 @@ namespace ShardingCore.Extensions public static void RemoveDbContextRelationModelSaveOnlyThatIsNamedType(this DbContext dbContext, Type shardingType) { -#if !EFCORE2 && !EFCORE3 && !EFCORE5 && !EFCORE6 +#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0 1 #endif -#if EFCORE2 ||EFCORE3 ||EFCORE5 +#if NETCOREAPP2_0 ||NETCOREAPP3_0 ||NET5_0 var contextModel = dbContext.Model as Model; #endif -#if EFCORE6 +#if NET6_0 var contextModel = dbContext.GetService().Model; var entityTypes = contextModel.GetEntityTypes(); foreach (var entityType in entityTypes) @@ -220,7 +220,7 @@ namespace ShardingCore.Extensions } #endif -#if EFCORE5 +#if NET5_0 var contextModelRelationalModel = contextModel.RelationalModel as RelationalModel; var entityTypes = contextModel.GetEntityTypes(); @@ -239,7 +239,7 @@ namespace ShardingCore.Extensions contextModelRelationalModel.Tables.Remove(valueTuples[i]); } #endif -#if EFCORE2 || EFCORE3 +#if NETCOREAPP2_0 || NETCOREAPP3_0 var entityTypes = contextModel.GetFieldValue("_entityTypes") as SortedDictionary; @@ -270,10 +270,10 @@ namespace ShardingCore.Extensions /// public static void RemoveModelCache(this DbContext dbContext) { -#if !EFCORE2&&!EFCORE3&&!EFCORE5&&!EFCORE6 +#if !NETCOREAPP2_0&&!NETCOREAPP3_0&&!NET5_0&&!NET6_0 throw new NotImplementedException(); #endif -#if EFCORE6 +#if NET6_0 var shardingModelSource = dbContext.GetService() as IShardingModelSource; var modelCacheKeyFactory = shardingModelSource.GetModelCacheKeyFactory(); object key1 = modelCacheKeyFactory.Create(dbContext,true); @@ -281,13 +281,13 @@ namespace ShardingCore.Extensions object key2 = modelCacheKeyFactory.Create(dbContext,false); shardingModelSource.Remove(key2); #endif -#if EFCORE5 +#if NET5_0 var shardingModelSource = dbContext.GetService() as IShardingModelSource; var modelCacheKeyFactory = shardingModelSource.GetModelCacheKeyFactory(); object key1 = modelCacheKeyFactory.Create(dbContext); shardingModelSource.Remove(key1); #endif -#if EFCORE3 +#if NETCOREAPP3_0 var shardingModelSource = dbContext.GetService() as IShardingModelSource; var modelCacheKeyFactory = shardingModelSource.GetModelCacheKeyFactory(); @@ -295,7 +295,7 @@ namespace ShardingCore.Extensions shardingModelSource.Remove(key1); #endif -#if EFCORE2 +#if NETCOREAPP2_0 var shardingModelSource = dbContext.GetService() as IShardingModelSource; var modelCacheKeyFactory = shardingModelSource.GetModelCacheKeyFactory(); diff --git a/src/ShardingCore/Extensions/InternalExtensions/InternalIEntityTypeExtension.cs b/src/ShardingCore/Extensions/InternalExtensions/InternalIEntityTypeExtension.cs index c34c6f9a..2fb1a389 100644 --- a/src/ShardingCore/Extensions/InternalExtensions/InternalIEntityTypeExtension.cs +++ b/src/ShardingCore/Extensions/InternalExtensions/InternalIEntityTypeExtension.cs @@ -17,10 +17,10 @@ namespace ShardingCore.Extensions.InternalExtensions /// public static string GetEntityTypeTableName(this IEntityType entityType) { -#if !EFCORE2 +#if !NETCOREAPP2_0 var tableName = entityType.GetTableName(); #endif -#if EFCORE2 +#if NETCOREAPP2_0 var tableName = entityType.Relational().TableName; #endif return tableName; diff --git a/src/ShardingCore/Extensions/LinqExtension.cs b/src/ShardingCore/Extensions/LinqExtension.cs index 0e6f06b3..eb2478d4 100644 --- a/src/ShardingCore/Extensions/LinqExtension.cs +++ b/src/ShardingCore/Extensions/LinqExtension.cs @@ -16,7 +16,7 @@ namespace ShardingCore.Extensions //public static void ForEach(this IEnumerable source) -#if !EFCORE5 +#if !NET5_0 public static HashSet ToHashSet( this IEnumerable source, IEqualityComparer comparer = null) diff --git a/src/ShardingCore/Extensions/ShardingExtension.cs b/src/ShardingCore/Extensions/ShardingExtension.cs index 1462f46d..2fda2112 100644 --- a/src/ShardingCore/Extensions/ShardingExtension.cs +++ b/src/ShardingCore/Extensions/ShardingExtension.cs @@ -64,10 +64,10 @@ namespace ShardingCore.Extensions { return null; } -#if !EFCORE2 +#if !NETCOREAPP2_0 return expression.Print(); #endif -#if EFCORE2 +#if NETCOREAPP2_0 return expression.ToString(); #endif } diff --git a/src/ShardingCore/Extensions/StreamMergeEnumerableExtension.cs b/src/ShardingCore/Extensions/StreamMergeEnumerableExtension.cs index 4c815015..eb03ccfc 100644 --- a/src/ShardingCore/Extensions/StreamMergeEnumerableExtension.cs +++ b/src/ShardingCore/Extensions/StreamMergeEnumerableExtension.cs @@ -10,10 +10,10 @@ namespace ShardingCore.Extensions { public static async Task> ToStreamListAsync(this IAsyncEnumerable source, int? take=null,CancellationToken cancellationToken=default) { -#if EFCORE2 +#if NETCOREAPP2_0 var list = await source.ToList(cancellationToken); #endif -#if !EFCORE2 +#if !NETCOREAPP2_0 var list = new List(take??4); await foreach (var element in source.WithCancellation(cancellationToken)) { @@ -45,7 +45,7 @@ namespace ShardingCore.Extensions public static async Task> ToFixedElementStreamListAsync(this IAsyncEnumerable source,int capacity,int maxVirtualElementCount,CancellationToken cancellationToken=default) { var fixedElementCollection = new FixedElementCollection(capacity); -#if EFCORE2 +#if NETCOREAPP2_0 var asyncEnumerator = source.GetEnumerator(); while (await asyncEnumerator.MoveNext(cancellationToken)) { @@ -56,7 +56,7 @@ namespace ShardingCore.Extensions } } #endif -#if !EFCORE2 +#if !NETCOREAPP2_0 await foreach (var element in source.WithCancellation(cancellationToken)) { fixedElementCollection.Add(element); diff --git a/src/ShardingCore/Helpers/MigrationReplaceItem.cs b/src/ShardingCore/Helpers/MigrationReplaceItem.cs index 746063d7..4be95dba 100644 --- a/src/ShardingCore/Helpers/MigrationReplaceItem.cs +++ b/src/ShardingCore/Helpers/MigrationReplaceItem.cs @@ -25,14 +25,14 @@ namespace ShardingCore.Helpers if (obj.GetType() != this.GetType()) return false; return Equals((MigrationReplaceItem)obj); } -#if !EFCORE2 +#if !NETCOREAPP2_0 public override int GetHashCode() { return HashCode.Combine(SourceName, TargetName); } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public override int GetHashCode() { diff --git a/src/ShardingCore/Sharding/AbstractShardingDbContext.cs b/src/ShardingCore/Sharding/AbstractShardingDbContext.cs index 6e927391..f4fbf98f 100644 --- a/src/ShardingCore/Sharding/AbstractShardingDbContext.cs +++ b/src/ShardingCore/Sharding/AbstractShardingDbContext.cs @@ -102,7 +102,7 @@ namespace ShardingCore.Sharding -#if !EFCORE2 +#if !NETCOREAPP2_0 public override ValueTask> AddAsync(TEntity entity, CancellationToken cancellationToken = new CancellationToken()) { @@ -118,7 +118,7 @@ namespace ShardingCore.Sharding return CreateGenericDbContext(entity).AddAsync(entity, cancellationToken); } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public override Task> AddAsync(TEntity entity, CancellationToken cancellationToken = new CancellationToken()) { if (IsExecutor) @@ -429,11 +429,11 @@ namespace ShardingCore.Sharding { using (var tran = await Database.BeginTransactionAsync(cancellationToken)) { - i = await ShardingDbContextExecutor.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken); -#if EFCORE2 - tran.Commit(); + i = await ShardingDbContextExecutor.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken); +#if NETCOREAPP2_0 + tran.Commit(); #endif -#if !EFCORE2 +#if !NETCOREAPP2_0 await tran.CommitAsync(cancellationToken); #endif } @@ -460,7 +460,7 @@ namespace ShardingCore.Sharding base.Dispose(); } } -#if !EFCORE2 +#if !NETCOREAPP2_0 public override async ValueTask DisposeAsync() { diff --git a/src/ShardingCore/Sharding/Abstractions/IShardingComplierExecutor.cs b/src/ShardingCore/Sharding/Abstractions/IShardingComplierExecutor.cs index 173f6365..463c3f2c 100644 --- a/src/ShardingCore/Sharding/Abstractions/IShardingComplierExecutor.cs +++ b/src/ShardingCore/Sharding/Abstractions/IShardingComplierExecutor.cs @@ -20,7 +20,7 @@ namespace ShardingCore.Sharding.Abstractions /// /// TResult Execute(IShardingDbContext shardingDbContext, Expression query); -#if !EFCORE2 +#if !NETCOREAPP2_0 /// /// execute query async /// @@ -31,7 +31,7 @@ namespace ShardingCore.Sharding.Abstractions /// TResult ExecuteAsync(IShardingDbContext shardingDbContext, Expression query, CancellationToken cancellationToken = new CancellationToken()); #endif -#if EFCORE2 +#if NETCOREAPP2_0 /// /// execute query async /// diff --git a/src/ShardingCore/Sharding/Abstractions/IShardingDbContextExecutor.cs b/src/ShardingCore/Sharding/Abstractions/IShardingDbContextExecutor.cs index 7488ca2a..c4490175 100644 --- a/src/ShardingCore/Sharding/Abstractions/IShardingDbContextExecutor.cs +++ b/src/ShardingCore/Sharding/Abstractions/IShardingDbContextExecutor.cs @@ -18,7 +18,7 @@ namespace ShardingCore.Sharding.Abstractions * @Email: 326308290@qq.com */ public interface IShardingDbContextExecutor : IDisposable -#if !EFCORE2 +#if !NETCOREAPP2_0 , IAsyncDisposable #endif @@ -78,7 +78,7 @@ namespace ShardingCore.Sharding.Abstractions void Commit(); IDictionary GetCurrentDbContexts(); -#if !EFCORE2 +#if !NETCOREAPP2_0 /// /// rollback async /// diff --git a/src/ShardingCore/Sharding/Abstractions/IShardingQueryExecutor.cs b/src/ShardingCore/Sharding/Abstractions/IShardingQueryExecutor.cs index 1a720ac7..d4365837 100644 --- a/src/ShardingCore/Sharding/Abstractions/IShardingQueryExecutor.cs +++ b/src/ShardingCore/Sharding/Abstractions/IShardingQueryExecutor.cs @@ -5,7 +5,7 @@ using ShardingCore.Sharding.Enumerators; using ShardingCore.Sharding.ShardingExecutors; using ShardingCore.Sharding.ShardingExecutors.Abstractions; -#if EFCORE2 +#if NETCOREAPP2_0 using Microsoft.EntityFrameworkCore.Internal; #endif diff --git a/src/ShardingCore/Sharding/Abstractions/IShardingTrackQueryExecutor.cs b/src/ShardingCore/Sharding/Abstractions/IShardingTrackQueryExecutor.cs index 74a35491..5caf9cd2 100644 --- a/src/ShardingCore/Sharding/Abstractions/IShardingTrackQueryExecutor.cs +++ b/src/ShardingCore/Sharding/Abstractions/IShardingTrackQueryExecutor.cs @@ -17,7 +17,7 @@ namespace ShardingCore.Sharding.Abstractions /// /// TResult Execute(IQueryCompilerContext queryCompilerContext); -#if !EFCORE2 +#if !NETCOREAPP2_0 /// /// execute query async /// @@ -30,7 +30,7 @@ namespace ShardingCore.Sharding.Abstractions #endif -#if EFCORE2 +#if NETCOREAPP2_0 /// /// execute query async /// diff --git a/src/ShardingCore/Sharding/Abstractions/IShardingTransaction.cs b/src/ShardingCore/Sharding/Abstractions/IShardingTransaction.cs index b2d02ab0..eb6f18ae 100644 --- a/src/ShardingCore/Sharding/Abstractions/IShardingTransaction.cs +++ b/src/ShardingCore/Sharding/Abstractions/IShardingTransaction.cs @@ -18,7 +18,7 @@ namespace ShardingCore.Sharding.Abstractions void NotifyShardingTransaction(); void Rollback(); void Commit(); -#if !EFCORE2 +#if !NETCOREAPP2_0 Task RollbackAsync(CancellationToken cancellationToken = new CancellationToken()); Task CommitAsync(CancellationToken cancellationToken = new CancellationToken()); #endif diff --git a/src/ShardingCore/Sharding/Abstractions/ISupportShardingTransaction.cs b/src/ShardingCore/Sharding/Abstractions/ISupportShardingTransaction.cs index d6933002..fc0ade64 100644 --- a/src/ShardingCore/Sharding/Abstractions/ISupportShardingTransaction.cs +++ b/src/ShardingCore/Sharding/Abstractions/ISupportShardingTransaction.cs @@ -22,7 +22,7 @@ namespace ShardingCore.Sharding.Abstractions // void NotifyShardingTransaction(); // void Rollback(); // void Commit(); -//#if !EFCORE2 +//#if !NETCOREAPP2_0 // Task RollbackAsync(CancellationToken cancellationToken = new CancellationToken()); // Task CommitAsync(CancellationToken cancellationToken = new CancellationToken()); //#endif diff --git a/src/ShardingCore/Sharding/EntityQueryConfigurations/EntityQueryBuilder.cs b/src/ShardingCore/Sharding/EntityQueryConfigurations/EntityQueryBuilder.cs index 4f1da019..8da4751d 100644 --- a/src/ShardingCore/Sharding/EntityQueryConfigurations/EntityQueryBuilder.cs +++ b/src/ShardingCore/Sharding/EntityQueryConfigurations/EntityQueryBuilder.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.Infrastructure; using ShardingCore.Exceptions; -#if EFCORE2 +#if NETCOREAPP2_0 using Microsoft.EntityFrameworkCore.Internal; #endif diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/EFCore2x/EFCore2TryCurrentAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/EFCore2x/EFCore2TryCurrentAsyncEnumerator.cs index 8cc34a88..9b4f156e 100644 --- a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/EFCore2x/EFCore2TryCurrentAsyncEnumerator.cs +++ b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/EFCore2x/EFCore2TryCurrentAsyncEnumerator.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync.EFCore2x +namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync.NETCOREAPP2_0x { /* * @Author: xjm @@ -14,13 +14,13 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync.EFCore2x * @Ver: 1.0 * @Email: 326308290@qq.com */ -#if EFCORE2 - internal class EFCore2TryCurrentAsyncEnumerator:IAsyncEnumerator +#if NETCOREAPP2_0 + internal class NETCOREAPP2_0TryCurrentAsyncEnumerator:IAsyncEnumerator { private readonly IAsyncEnumerator _asyncEnumerator; private bool currentMoved=false; - public EFCore2TryCurrentAsyncEnumerator(IAsyncEnumerator asyncEnumerator) + public NETCOREAPP2_0TryCurrentAsyncEnumerator(IAsyncEnumerator asyncEnumerator) { _asyncEnumerator = asyncEnumerator; } diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryGroupByOrderStreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryGroupByOrderStreamMergeAsyncEnumerator.cs index 493af5f2..0e3f1a03 100644 --- a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryGroupByOrderStreamMergeAsyncEnumerator.cs +++ b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryGroupByOrderStreamMergeAsyncEnumerator.cs @@ -34,10 +34,10 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync private async Task> GetAllRowsAsync(IStreamMergeAsyncEnumerator streamMergeAsyncEnumerator) { var list = new List(); -#if !EFCORE2 +#if !NETCOREAPP2_0 while (await streamMergeAsyncEnumerator.MoveNextAsync()) #endif -#if EFCORE2 +#if NETCOREAPP2_0 while (await streamMergeAsyncEnumerator.MoveNext(new CancellationToken())) #endif { @@ -49,10 +49,10 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync private IEnumerator GetAllRows(IStreamMergeAsyncEnumerator streamMergeAsyncEnumerator) { var list = new List(); -#if !EFCORE2 +#if !NETCOREAPP2_0 while ( streamMergeAsyncEnumerator.MoveNext()) #endif -#if EFCORE2 +#if NETCOREAPP2_0 while (streamMergeAsyncEnumerator.MoveNext()) #endif { @@ -76,7 +76,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync { return _inMemoryReallyCount; } -#if !EFCORE2 +#if !NETCOREAPP2_0 public ValueTask DisposeAsync() { @@ -134,7 +134,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync { return _inMemoryEnumerator.Current; } -#if EFCORE2 +#if NETCOREAPP2_0 public void Dispose() { _inMemoryEnumerator?.Dispose(); diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryReverseStreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryReverseStreamMergeAsyncEnumerator.cs index 6d10a290..a4a66618 100644 --- a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryReverseStreamMergeAsyncEnumerator.cs +++ b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryReverseStreamMergeAsyncEnumerator.cs @@ -30,7 +30,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync return _inMemoryReallyCount; } -#if !EFCORE2 +#if !NETCOREAPP2_0 public async ValueTask DisposeAsync() { @@ -56,7 +56,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync return _reverseEnumerator.MoveNext(); } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public async Task MoveNext(CancellationToken cancellationToken) { if (_first) diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryStreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryStreamMergeAsyncEnumerator.cs index 8aa7120e..7c2fd6c7 100644 --- a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryStreamMergeAsyncEnumerator.cs +++ b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryStreamMergeAsyncEnumerator.cs @@ -33,10 +33,10 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync private async Task> GetAllRowsAsync(IStreamMergeAsyncEnumerator streamMergeAsyncEnumerator) { var list = new List(); -#if !EFCORE2 +#if !NETCOREAPP2_0 while (await streamMergeAsyncEnumerator.MoveNextAsync()) #endif -#if EFCORE2 +#if NETCOREAPP2_0 while (await streamMergeAsyncEnumerator.MoveNext(new CancellationToken())) #endif { @@ -48,10 +48,10 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync private IEnumerator GetAllRows(IStreamMergeAsyncEnumerator streamMergeAsyncEnumerator) { var list = new List(); -#if !EFCORE2 +#if !NETCOREAPP2_0 while ( streamMergeAsyncEnumerator.MoveNext()) #endif -#if EFCORE2 +#if NETCOREAPP2_0 while (streamMergeAsyncEnumerator.MoveNext()) #endif { @@ -75,7 +75,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync { return _inMemoryReallyCount; } -#if !EFCORE2 +#if !NETCOREAPP2_0 public ValueTask DisposeAsync() { @@ -133,7 +133,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync { return _inMemoryEnumerator.Current; } -#if EFCORE2 +#if NETCOREAPP2_0 public void Dispose() { _inMemoryEnumerator?.Dispose(); diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/MultiAggregateOrderStreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/MultiAggregateOrderStreamMergeAsyncEnumerator.cs index 02d05e9e..f0939ab6 100644 --- a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/MultiAggregateOrderStreamMergeAsyncEnumerator.cs +++ b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/MultiAggregateOrderStreamMergeAsyncEnumerator.cs @@ -58,19 +58,19 @@ namespace ShardingCore.Sharding.Enumerators return _mergeContext.SelectContext.SelectProperties.Where(o => !(o is SelectAggregateProperty)) .Select(o => first.GetValueByExpression(o.PropertyName).value).ToList(); } -#if !EFCORE2 +#if !NETCOREAPP2_0 public async ValueTask MoveNextAsync() #endif -#if EFCORE2 +#if NETCOREAPP2_0 public async Task MoveNext(CancellationToken cancellationToken = new CancellationToken()) #endif { if (_queue.IsEmpty()) return false; -#if !EFCORE2 +#if !NETCOREAPP2_0 var hasNext = await SetCurrentValueAsync(); #endif -#if EFCORE2 +#if NETCOREAPP2_0 var hasNext = await SetCurrentValueAsync(cancellationToken); #endif if (hasNext) @@ -91,10 +91,10 @@ namespace ShardingCore.Sharding.Enumerators return true; } -#if !EFCORE2 +#if !NETCOREAPP2_0 private async ValueTask SetCurrentValueAsync() #endif -#if EFCORE2 +#if NETCOREAPP2_0 private async Task SetCurrentValueAsync(CancellationToken cancellationToken = new CancellationToken()) #endif { @@ -106,10 +106,10 @@ namespace ShardingCore.Sharding.Enumerators currentValues.Add(current); var first = _queue.Poll(); -#if !EFCORE2 +#if !NETCOREAPP2_0 if (await first.MoveNextAsync()) #endif -#if EFCORE2 +#if NETCOREAPP2_0 if (await first.MoveNext(cancellationToken)) #endif { @@ -240,7 +240,7 @@ namespace ShardingCore.Sharding.Enumerators return CurrentValue; } -#if !EFCORE2 +#if !NETCOREAPP2_0 public async ValueTask DisposeAsync() { diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/MultiOrderStreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/MultiOrderStreamMergeAsyncEnumerator.cs index 336598d5..9dfb2ab5 100644 --- a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/MultiOrderStreamMergeAsyncEnumerator.cs +++ b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/MultiOrderStreamMergeAsyncEnumerator.cs @@ -45,10 +45,10 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync _currentEnumerator = _queue.IsEmpty() ? _enumerators.FirstOrDefault() : _queue.Peek(); } -#if !EFCORE2 +#if !NETCOREAPP2_0 public async ValueTask MoveNextAsync() #endif -#if EFCORE2 +#if NETCOREAPP2_0 public async Task MoveNext(CancellationToken cancellationToken = new CancellationToken()) #endif { @@ -61,11 +61,11 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync } var first = _queue.Poll(); -#if !EFCORE2 +#if !NETCOREAPP2_0 if (await first.MoveNextAsync()) #endif -#if EFCORE2 +#if NETCOREAPP2_0 if (await first.MoveNext(cancellationToken)) #endif @@ -128,7 +128,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync return _currentEnumerator.GetCurrent(); } -#if !EFCORE2 +#if !NETCOREAPP2_0 public async ValueTask DisposeAsync() { diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/OneAtMostElementStreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/OneAtMostElementStreamMergeAsyncEnumerator.cs index 97a1cfe7..d22e0c2a 100644 --- a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/OneAtMostElementStreamMergeAsyncEnumerator.cs +++ b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/OneAtMostElementStreamMergeAsyncEnumerator.cs @@ -30,7 +30,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync _moveIndex++; return HasElement(); } -#if !EFCORE2&&!EFCORE3&&!EFCORE5 +#if !NETCOREAPP2_0&&!NETCOREAPP3_0&&!NET5_0 public ValueTask DisposeAsync() { return ValueTask.CompletedTask; @@ -46,7 +46,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync } #endif -#if EFCORE3 || EFCORE5 +#if NETCOREAPP3_0 || NET5_0 public ValueTask DisposeAsync() { return new ValueTask(); @@ -100,7 +100,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync { return _constantElement; } -#if EFCORE2 +#if NETCOREAPP2_0 public void Dispose() { } diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/OrderStreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/OrderStreamMergeAsyncEnumerator.cs index cf1f9d55..3b9d5747 100644 --- a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/OrderStreamMergeAsyncEnumerator.cs +++ b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/OrderStreamMergeAsyncEnumerator.cs @@ -37,17 +37,17 @@ namespace ShardingCore.Sharding.Enumerators _orderValues = HasElement() ? GetCurrentOrderValues() : new List(0); } -#if !EFCORE2 +#if !NETCOREAPP2_0 public async ValueTask MoveNextAsync() #endif -#if EFCORE2 +#if NETCOREAPP2_0 public async Task MoveNext(CancellationToken cancellationToken = new CancellationToken()) #endif { -#if !EFCORE2 +#if !NETCOREAPP2_0 var has = await _enumerator.MoveNextAsync(); #endif -#if EFCORE2 +#if NETCOREAPP2_0 var has = await _enumerator.MoveNext(cancellationToken); #endif SetOrderValues(); @@ -134,7 +134,7 @@ namespace ShardingCore.Sharding.Enumerators { return _orderValues ?? new List(0); } -#if !EFCORE2 +#if !NETCOREAPP2_0 public ValueTask DisposeAsync() { return _enumerator.DisposeAsync(); diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/PaginationStreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/PaginationStreamMergeAsyncEnumerator.cs index 1ae09ecf..d8e74c98 100644 --- a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/PaginationStreamMergeAsyncEnumerator.cs +++ b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/PaginationStreamMergeAsyncEnumerator.cs @@ -34,20 +34,20 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync else _enumerator = new MultiOrderStreamMergeAsyncEnumerator(_mergeContext, sources); } -#if !EFCORE2 +#if !NETCOREAPP2_0 public async ValueTask MoveNextAsync() #endif -#if EFCORE2 +#if NETCOREAPP2_0 public async Task MoveNext(CancellationToken cancellationToken = new CancellationToken()) #endif { //如果合并数据的时候不需要跳过也没有take多少那么就是直接next while (_skip.GetValueOrDefault() > this.realSkip) { -#if !EFCORE2 +#if !NETCOREAPP2_0 var has = await _enumerator.MoveNextAsync(); #endif -#if EFCORE2 +#if NETCOREAPP2_0 var has = await _enumerator.MoveNext(cancellationToken); #endif @@ -56,10 +56,10 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync return false; } -#if !EFCORE2 +#if !NETCOREAPP2_0 var next = await _enumerator.MoveNextAsync(); #endif -#if EFCORE2 +#if NETCOREAPP2_0 var next = await _enumerator.MoveNext(cancellationToken); #endif @@ -129,7 +129,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync { _enumerator.Dispose(); } -#if !EFCORE2 +#if !NETCOREAPP2_0 public ValueTask DisposeAsync() { diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/StreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/StreamMergeAsyncEnumerator.cs index 2aa4c2e3..55e5c47a 100644 --- a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/StreamMergeAsyncEnumerator.cs +++ b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/StreamMergeAsyncEnumerator.cs @@ -48,7 +48,7 @@ namespace ShardingCore.Sharding.Enumerators } return false; } -#if !EFCORE2 +#if !NETCOREAPP2_0 public async ValueTask DisposeAsync() { if (_asyncEnumerator) @@ -111,7 +111,7 @@ namespace ShardingCore.Sharding.Enumerators if (_syncEnumerator) return _syncSource.Current; return default; } -#if EFCORE2 +#if NETCOREAPP2_0 public void Dispose() { _asyncSource?.Dispose(); diff --git a/src/ShardingCore/Sharding/Enumerators/TrackerEnumerables/AsyncTrackerEnumerable.cs b/src/ShardingCore/Sharding/Enumerators/TrackerEnumerables/AsyncTrackerEnumerable.cs index b8356126..500aedc0 100644 --- a/src/ShardingCore/Sharding/Enumerators/TrackerEnumerables/AsyncTrackerEnumerable.cs +++ b/src/ShardingCore/Sharding/Enumerators/TrackerEnumerables/AsyncTrackerEnumerable.cs @@ -20,14 +20,14 @@ namespace ShardingCore.Sharding.Enumerators.TrackerEnumerables _shardingDbContext = shardingDbContext; _asyncEnumerable = asyncEnumerable; } -#if !EFCORE2 +#if !NETCOREAPP2_0 public IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = new CancellationToken()) { return new AsyncTrackerEnumerator(_shardingDbContext,_asyncEnumerable.GetAsyncEnumerator(cancellationToken)); } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public IAsyncEnumerator GetEnumerator() { return new AsyncTrackerEnumerator(_shardingDbContext, _asyncEnumerable.GetEnumerator()); diff --git a/src/ShardingCore/Sharding/Enumerators/TrackerEnumerators/AsyncTrackerEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/TrackerEnumerators/AsyncTrackerEnumerator.cs index 77f7ca81..10d60f85 100644 --- a/src/ShardingCore/Sharding/Enumerators/TrackerEnumerators/AsyncTrackerEnumerator.cs +++ b/src/ShardingCore/Sharding/Enumerators/TrackerEnumerators/AsyncTrackerEnumerator.cs @@ -17,7 +17,7 @@ namespace ShardingCore.Sharding.Enumerators.TrackerEnumerators * @Ver: 1.0 * @Email: 326308290@qq.com */ -#if !EFCORE2 +#if !NETCOREAPP2_0 internal class AsyncTrackerEnumerator : IAsyncEnumerator { @@ -60,7 +60,7 @@ namespace ShardingCore.Sharding.Enumerators.TrackerEnumerators } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public class AsyncTrackerEnumerator : IAsyncEnumerator { diff --git a/src/ShardingCore/Sharding/MergeContexts/QueryableRewriteEngine.cs b/src/ShardingCore/Sharding/MergeContexts/QueryableRewriteEngine.cs index 393a18d5..cf848b6d 100644 --- a/src/ShardingCore/Sharding/MergeContexts/QueryableRewriteEngine.cs +++ b/src/ShardingCore/Sharding/MergeContexts/QueryableRewriteEngine.cs @@ -13,7 +13,7 @@ using ShardingCore.Sharding.Abstractions; using ShardingCore.Sharding.ShardingExecutors.Abstractions; using ShardingCore.Sharding.Visitors.Selects; -#if EFCORE2 +#if NETCOREAPP2_0 using Microsoft.EntityFrameworkCore.Query.Sql; #endif diff --git a/src/ShardingCore/Sharding/MergeEngines/Enumerables/EmptyQueryEnumerator.cs b/src/ShardingCore/Sharding/MergeEngines/Enumerables/EmptyQueryEnumerator.cs index b82dc1e1..143590e7 100644 --- a/src/ShardingCore/Sharding/MergeEngines/Enumerables/EmptyQueryEnumerator.cs +++ b/src/ShardingCore/Sharding/MergeEngines/Enumerables/EmptyQueryEnumerator.cs @@ -9,7 +9,7 @@ namespace ShardingCore.Sharding.MergeEngines.Enumerables { -#if !EFCORE2 +#if !NETCOREAPP2_0 public ValueTask DisposeAsync() { return new ValueTask(); @@ -20,7 +20,7 @@ namespace ShardingCore.Sharding.MergeEngines.Enumerables } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public Task MoveNext(CancellationToken cancellationToken) { return Task.FromResult(false); diff --git a/src/ShardingCore/Sharding/MergeEngines/EnumeratorStreamMergeEngines/AsyncEnumeratorStreamMergeEngine.cs b/src/ShardingCore/Sharding/MergeEngines/EnumeratorStreamMergeEngines/AsyncEnumeratorStreamMergeEngine.cs index 49f7ac1e..b0922660 100644 --- a/src/ShardingCore/Sharding/MergeEngines/EnumeratorStreamMergeEngines/AsyncEnumeratorStreamMergeEngine.cs +++ b/src/ShardingCore/Sharding/MergeEngines/EnumeratorStreamMergeEngines/AsyncEnumeratorStreamMergeEngine.cs @@ -25,7 +25,7 @@ namespace ShardingCore.Sharding.MergeEngines.EnumeratorStreamMergeEngines } -#if !EFCORE2 +#if !NETCOREAPP2_0 public IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = new CancellationToken()) { cancellationToken.ThrowIfCancellationRequested(); @@ -46,7 +46,7 @@ namespace ShardingCore.Sharding.MergeEngines.EnumeratorStreamMergeEngines } #endif -#if EFCORE2 +#if NETCOREAPP2_0 IAsyncEnumerator IAsyncEnumerable.GetEnumerator() { if (!_mergeContext.TryPrepareExecuteContinueQuery(() => new EmptyQueryEnumerator(),out var emptyQueryEnumerator)) diff --git a/src/ShardingCore/Sharding/MergeEngines/Executors/Enumerables/Abstractions/AbstractEnumerableExecutor.cs b/src/ShardingCore/Sharding/MergeEngines/Executors/Enumerables/Abstractions/AbstractEnumerableExecutor.cs index 28ea8f70..3f602727 100644 --- a/src/ShardingCore/Sharding/MergeEngines/Executors/Enumerables/Abstractions/AbstractEnumerableExecutor.cs +++ b/src/ShardingCore/Sharding/MergeEngines/Executors/Enumerables/Abstractions/AbstractEnumerableExecutor.cs @@ -5,13 +5,13 @@ using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using ShardingCore.Sharding.Enumerators; using ShardingCore.Sharding.Enumerators.StreamMergeAsync; -using ShardingCore.Sharding.Enumerators.StreamMergeAsync.EFCore2x; +using ShardingCore.Sharding.Enumerators.StreamMergeAsync.NETCOREAPP2_0x; using ShardingCore.Sharding.MergeEngines.Common; using ShardingCore.Sharding.MergeEngines.Executors.Abstractions; using ShardingCore.Sharding.MergeEngines.Executors.CircuitBreakers; using ShardingCore.Sharding.MergeEngines.ShardingMergeEngines.Abstractions; using ShardingCore.Sharding.ShardingExecutors; -#if EFCORE2 +#if NETCOREAPP2_0 using Microsoft.EntityFrameworkCore.Extensions.Internal; #endif @@ -128,14 +128,14 @@ namespace ShardingCore.Sharding.MergeEngines.Executors.Enumerables.Abstractions /// public async Task> GetAsyncEnumerator0(IQueryable newQueryable) { -#if !EFCORE2 +#if !NETCOREAPP2_0 var enumator = newQueryable.AsAsyncEnumerable().GetAsyncEnumerator(); await enumator.MoveNextAsync(); return enumator; #endif -#if EFCORE2 +#if NETCOREAPP2_0 var enumator = - new EFCore2TryCurrentAsyncEnumerator(newQueryable.AsAsyncEnumerable().GetEnumerator()); + new NETCOREAPP2_0TryCurrentAsyncEnumerator(newQueryable.AsAsyncEnumerable().GetEnumerator()); await enumator.MoveNext(); return enumator; #endif diff --git a/src/ShardingCore/Sharding/MergeEngines/Executors/Methods/SumMethodExecutor.cs b/src/ShardingCore/Sharding/MergeEngines/Executors/Methods/SumMethodExecutor.cs index 7c98b342..71a7cbe2 100644 --- a/src/ShardingCore/Sharding/MergeEngines/Executors/Methods/SumMethodExecutor.cs +++ b/src/ShardingCore/Sharding/MergeEngines/Executors/Methods/SumMethodExecutor.cs @@ -51,12 +51,12 @@ namespace ShardingCore.Sharding.MergeEngines.Executors.Methods if (!resultType.IsNumericType()) throw new ShardingCoreException( $"not support {GetStreamMergeContext().MergeQueryCompilerContext.GetQueryExpression().ShardingPrint()} result {resultType}"); -#if !EFCORE2 +#if !NETCOREAPP2_0 return ShardingEntityFrameworkQueryableExtensions.ExecuteAsync>( ShardingQueryableMethods.GetSumWithoutSelector(resultType), (IQueryable)queryable, (Expression)null, cancellationToken); #endif -#if EFCORE2 +#if NETCOREAPP2_0 return ShardingEntityFrameworkQueryableExtensions.ExecuteAsync(ShardingQueryableMethods.GetSumWithoutSelector(resultType), (IQueryable)queryable, cancellationToken); #endif } diff --git a/src/ShardingCore/Sharding/MergeEngines/ShardingMergeEngines/Abstractions/StreamMerge/AbstractStreamEnumerable.cs b/src/ShardingCore/Sharding/MergeEngines/ShardingMergeEngines/Abstractions/StreamMerge/AbstractStreamEnumerable.cs index 7578f98c..6ca5881a 100644 --- a/src/ShardingCore/Sharding/MergeEngines/ShardingMergeEngines/Abstractions/StreamMerge/AbstractStreamEnumerable.cs +++ b/src/ShardingCore/Sharding/MergeEngines/ShardingMergeEngines/Abstractions/StreamMerge/AbstractStreamEnumerable.cs @@ -4,7 +4,7 @@ using System.Threading; using ShardingCore.Sharding.Enumerators; using ShardingCore.Sharding.MergeEngines.Executors.Abstractions; using ShardingCore.Sharding.MergeEngines.ShardingExecutors; -#if EFCORE2 +#if NETCOREAPP2_0 using Microsoft.EntityFrameworkCore.Extensions.Internal; #endif @@ -27,7 +27,7 @@ namespace ShardingCore.Sharding.MergeEngines.ShardingMergeEngines.Abstractions.S } -#if !EFCORE2 +#if !NETCOREAPP2_0 public IAsyncEnumerator GetAsyncEnumerator( CancellationToken cancellationToken = new CancellationToken()) { @@ -35,7 +35,7 @@ namespace ShardingCore.Sharding.MergeEngines.ShardingMergeEngines.Abstractions.S } #endif -#if EFCORE2 +#if NETCOREAPP2_0 IAsyncEnumerator IAsyncEnumerable.GetEnumerator() { return GetStreamMergeAsyncEnumerator(true); diff --git a/src/ShardingCore/Sharding/Parsers/Visitors/ShardingQueryPrepareVisitor.cs b/src/ShardingCore/Sharding/Parsers/Visitors/ShardingQueryPrepareVisitor.cs index da8247b4..ec5faee8 100644 --- a/src/ShardingCore/Sharding/Parsers/Visitors/ShardingQueryPrepareVisitor.cs +++ b/src/ShardingCore/Sharding/Parsers/Visitors/ShardingQueryPrepareVisitor.cs @@ -23,7 +23,7 @@ namespace ShardingCore.Sharding.Parsers.Visitors /// Author: xjm /// Created: 2022/5/1 21:43:12 /// Email: 326308290@qq.com -#if !EFCORE2 && !EFCORE3 && !EFCORE5 && !EFCORE6 +#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0 error #endif internal class ShardingQueryPrepareVisitor : ExpressionVisitor @@ -57,7 +57,7 @@ namespace ShardingCore.Sharding.Parsers.Visitors shardingQueryableAsSequenceOptions, shardingEntities, isNoTracking, isIgnoreFilter); } -#if EFCORE2 || EFCORE3 +#if NETCOREAPP2_0 || NETCOREAPP3_0 protected override Expression VisitConstant(ConstantExpression node) { if (node.Value is IQueryable queryable) @@ -68,7 +68,7 @@ namespace ShardingCore.Sharding.Parsers.Visitors return base.VisitConstant(node); } #endif -#if EFCORE5 || EFCORE6 +#if NET5_0 || NET6_0 protected override Expression VisitExtension(Expression node) { if (node is QueryRootExpression queryRootExpression) diff --git a/src/ShardingCore/Sharding/ShardingDbContextExecutors/DataSourceDbContext.cs b/src/ShardingCore/Sharding/ShardingDbContextExecutors/DataSourceDbContext.cs index 19757f67..1576e737 100644 --- a/src/ShardingCore/Sharding/ShardingDbContextExecutors/DataSourceDbContext.cs +++ b/src/ShardingCore/Sharding/ShardingDbContextExecutors/DataSourceDbContext.cs @@ -377,7 +377,7 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors throw; } } -#if !EFCORE2 +#if !NETCOREAPP2_0 public async Task RollbackAsync(CancellationToken cancellationToken = new CancellationToken()) { cancellationToken.ThrowIfCancellationRequested(); @@ -421,7 +421,7 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors dataSourceDbContext.Value.Dispose(); } } -#if !EFCORE2 +#if !NETCOREAPP2_0 public async ValueTask DisposeAsync() { foreach (var dataSourceDbContext in _dataSourceDbContexts) diff --git a/src/ShardingCore/Sharding/ShardingDbContextExecutors/IDataSourceDbContext.cs b/src/ShardingCore/Sharding/ShardingDbContextExecutors/IDataSourceDbContext.cs index 4c199c41..370a946b 100644 --- a/src/ShardingCore/Sharding/ShardingDbContextExecutors/IDataSourceDbContext.cs +++ b/src/ShardingCore/Sharding/ShardingDbContextExecutors/IDataSourceDbContext.cs @@ -22,7 +22,7 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors /// 同数据源下的dbcontext管理者 /// public interface IDataSourceDbContext : IDisposable -#if !EFCORE2 +#if !NETCOREAPP2_0 , IAsyncDisposable #endif { @@ -46,7 +46,7 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors void Rollback(); void Commit(int dataSourceCount); -#if !EFCORE2 +#if !NETCOREAPP2_0 Task RollbackAsync(CancellationToken cancellationToken = new CancellationToken()); Task CommitAsync(int dataSourceCount,CancellationToken cancellationToken = new CancellationToken()); #endif diff --git a/src/ShardingCore/Sharding/ShardingDbContextExecutors/ShardingDbContextExecutor.cs b/src/ShardingCore/Sharding/ShardingDbContextExecutors/ShardingDbContextExecutor.cs index 4939eff4..a206551d 100644 --- a/src/ShardingCore/Sharding/ShardingDbContextExecutors/ShardingDbContextExecutor.cs +++ b/src/ShardingCore/Sharding/ShardingDbContextExecutors/ShardingDbContextExecutor.cs @@ -217,7 +217,7 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors dbContextCache.Value.Dispose(); } } -#if !EFCORE2 +#if !NETCOREAPP2_0 public async Task RollbackAsync(CancellationToken cancellationToken = new CancellationToken()) { diff --git a/src/ShardingCore/Sharding/ShardingEntityFrameworkQueryableExtensions.cs b/src/ShardingCore/Sharding/ShardingEntityFrameworkQueryableExtensions.cs index d72d6bcf..e6a8899b 100644 --- a/src/ShardingCore/Sharding/ShardingEntityFrameworkQueryableExtensions.cs +++ b/src/ShardingCore/Sharding/ShardingEntityFrameworkQueryableExtensions.cs @@ -11,7 +11,7 @@ using Microsoft.EntityFrameworkCore.Internal; using Microsoft.EntityFrameworkCore.Query; using Microsoft.EntityFrameworkCore.Query.Internal; -#if EFCORE3 +#if NETCOREAPP3_0 using Microsoft.EntityFrameworkCore.Query.Internal; #endif @@ -20,7 +20,7 @@ namespace ShardingCore.Sharding { internal class ShardingEntityFrameworkQueryableExtensions { -#if !EFCORE2 +#if !NETCOREAPP2_0 public static TResult ExecuteAsync( MethodInfo operatorMethodInfo, IQueryable source, @@ -90,7 +90,7 @@ namespace ShardingCore.Sharding #endif -#if EFCORE2 +#if NETCOREAPP2_0 public static Task ExecuteAsync( diff --git a/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingCompilerExecutor.cs b/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingCompilerExecutor.cs index dac76c32..59adaf86 100644 --- a/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingCompilerExecutor.cs +++ b/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingCompilerExecutor.cs @@ -49,7 +49,7 @@ namespace ShardingCore.Sharding.ShardingExecutors } -#if !EFCORE2 +#if !NETCOREAPP2_0 public TResult ExecuteAsync(IShardingDbContext shardingDbContext, Expression query, CancellationToken cancellationToken = new CancellationToken()) @@ -66,7 +66,7 @@ namespace ShardingCore.Sharding.ShardingExecutors } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public IAsyncEnumerable ExecuteAsync(IShardingDbContext shardingDbContext, Expression query) { //预解析表达式 diff --git a/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingQueryExecutor.cs b/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingQueryExecutor.cs index f56442ea..32cb84b0 100644 --- a/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingQueryExecutor.cs +++ b/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingQueryExecutor.cs @@ -16,7 +16,7 @@ using ShardingCore.Extensions.InternalExtensions; using ShardingCore.Sharding.MergeEngines; using ShardingCore.Sharding.MergeEngines.ShardingMergeEngines; using ShardingCore.Sharding.MergeEngines.ShardingMergeEngines.Abstractions.InMemoryMerge; -#if EFCORE2 +#if NETCOREAPP2_0 using Microsoft.EntityFrameworkCore.Internal; #endif diff --git a/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingTrackQueryExecutor.cs b/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingTrackQueryExecutor.cs index c957151f..7b50d32e 100644 --- a/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingTrackQueryExecutor.cs +++ b/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingTrackQueryExecutor.cs @@ -110,7 +110,7 @@ namespace ShardingCore.Sharding.ShardingExecutors .Invoke(_nativeTrackQueryExecutor, new object[] { queryCompilerContext, result }); } -#if !EFCORE2 +#if !NETCOREAPP2_0 public TResult ExecuteAsync(IQueryCompilerContext queryCompilerContext, CancellationToken cancellationToken = new CancellationToken()) { @@ -132,7 +132,7 @@ namespace ShardingCore.Sharding.ShardingExecutors return ResultTrackExecute(result, queryCompilerContext, TrackAsyncEnumerable, TrackAsync); } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public IAsyncEnumerable ExecuteAsync(IQueryCompilerContext queryCompilerContext) { diff --git a/src/ShardingCore/Sharding/StreamMergeContext.cs b/src/ShardingCore/Sharding/StreamMergeContext.cs index 30a783df..7af48075 100644 --- a/src/ShardingCore/Sharding/StreamMergeContext.cs +++ b/src/ShardingCore/Sharding/StreamMergeContext.cs @@ -35,7 +35,7 @@ namespace ShardingCore.Sharding * @Email: 326308290@qq.com */ public class StreamMergeContext : IMergeParseContext, IDisposable, IPrint -#if !EFCORE2 +#if !NETCOREAPP2_0 , IAsyncDisposable #endif { @@ -362,7 +362,7 @@ namespace ShardingCore.Sharding dbContext.Dispose(); } } -#if !EFCORE2 +#if !NETCOREAPP2_0 public async ValueTask DisposeAsync() { @@ -402,7 +402,7 @@ namespace ShardingCore.Sharding ReSetOrders(propertyOrders); } } -#if !EFCORE2 +#if !NETCOREAPP2_0 public async ValueTask DbContextDisposeAsync(DbContext dbContext) { @@ -416,7 +416,7 @@ namespace ShardingCore.Sharding return false; } #endif -#if EFCORE2 +#if NETCOREAPP2_0 public Task DbContextDisposeAsync(DbContext dbContext) { diff --git a/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor.cs b/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor.cs index d97ad99e..25830d18 100644 --- a/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor.cs +++ b/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor.cs @@ -153,7 +153,7 @@ namespace ShardingCore.Core.Internal.Visitors } } -#if EFCORE2 || EFCORE3 +#if NETCOREAPP2_0 || NETCOREAPP3_0 internal class DbContextReplaceQueryableVisitor : DbContextInnerMemberReferenceReplaceQueryableVisitor { private readonly DbContext _dbContext; @@ -193,7 +193,7 @@ namespace ShardingCore.Core.Internal.Visitors } #endif -#if EFCORE5 || EFCORE6 +#if NET5_0 || NET6_0 internal class DbContextReplaceQueryableVisitor : DbContextInnerMemberReferenceReplaceQueryableVisitor { private readonly DbContext _dbContext; diff --git a/src/ShardingCore/Sharding/Visitors/Querys/QueryEntitiesVisitor.cs b/src/ShardingCore/Sharding/Visitors/Querys/QueryEntitiesVisitor.cs index 493739ed..dc9b1577 100644 --- a/src/ShardingCore/Sharding/Visitors/Querys/QueryEntitiesVisitor.cs +++ b/src/ShardingCore/Sharding/Visitors/Querys/QueryEntitiesVisitor.cs @@ -17,10 +17,10 @@ namespace ShardingCore.Core.Internal.Visitors.Querys * @Date: Saturday, 20 February 2021 11:14:35 * @Email: 326308290@qq.com */ -#if !EFCORE2 && !EFCORE3 && !EFCORE5 && !EFCORE6 +#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0 error #endif -#if EFCORE2 || EFCORE3 +#if NETCOREAPP2_0 || NETCOREAPP3_0 /// /// 获取分表类型 /// @@ -117,7 +117,7 @@ namespace ShardingCore.Core.Internal.Visitors.Querys } #endif -#if EFCORE5 || EFCORE6 +#if NET5_0 || NET6_0 /// /// 获取分表类型 /// diff --git a/src/ShardingCore/ShardingCore.csproj b/src/ShardingCore/ShardingCore.csproj index 15b83cc3..f0b9d4e5 100644 --- a/src/ShardingCore/ShardingCore.csproj +++ b/src/ShardingCore/ShardingCore.csproj @@ -1,21 +1,62 @@ - + - net6.0 - $(EFCORE6) + netcoreapp2;netcoreapp3;net5;net6 + $(NET6_0) true - TRACE;DEBUG;EFCORE6; + TRACE;DEBUG; latest https://github.com/dotnetcore/sharding-core logo.png - - true - bin\Release\ShardingCore.xml + + true + bin\Release\ShardingCore.2x.xml latest - + + true + bin\Release\ShardingCore.3x.xml + latest + + + + true + bin\Release\ShardingCore.5x.xml + latest + + + + true + bin\Release\ShardingCore.6x.xml + latest + + latest + + 1701;1702;1591; + + + 1701;1702;1591; + + + 1701;1702;1591; + + + 1701;1702;1591; + + + 1701;1702;1591; + + + 1701;1702;1591; + + + 1701;1702;1591; + + + 1701;1702;1591; + @@ -30,12 +71,22 @@ \ - - - - - - + + + + + + + + + + + + + + + + diff --git a/test/ShardingCore.Test2x/ShardingCore.Test2x.csproj b/test/ShardingCore.Test2x/ShardingCore.Test2x.csproj index ee80d2e9..65cb3330 100644 --- a/test/ShardingCore.Test2x/ShardingCore.Test2x.csproj +++ b/test/ShardingCore.Test2x/ShardingCore.Test2x.csproj @@ -1,4 +1,4 @@ - + net5.0 @@ -16,8 +16,9 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - + + + \ No newline at end of file diff --git a/test/ShardingCore.Test3x/ShardingCore.Test3x.csproj b/test/ShardingCore.Test3x/ShardingCore.Test3x.csproj index d461518f..6c8f587b 100644 --- a/test/ShardingCore.Test3x/ShardingCore.Test3x.csproj +++ b/test/ShardingCore.Test3x/ShardingCore.Test3x.csproj @@ -17,7 +17,7 @@ - - + + diff --git a/test/ShardingCore.Test5x/ShardingCore.Test5x.csproj b/test/ShardingCore.Test5x/ShardingCore.Test5x.csproj index 948c3aaa..90a03159 100644 --- a/test/ShardingCore.Test5x/ShardingCore.Test5x.csproj +++ b/test/ShardingCore.Test5x/ShardingCore.Test5x.csproj @@ -20,6 +20,6 @@ - + From dadeb5086f0763fb1c1c53f2bf2f04be45568a64 Mon Sep 17 00:00:00 2001 From: MysticBoy Date: Wed, 28 Sep 2022 13:28:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8A=9B=E5=BC=83?= =?UTF-8?q?=E7=9A=84=E9=A1=B9=E7=9B=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src2x/ShardingCore.2x/ShardingCore.2x.csproj | 52 -------------------- src3x/ShardingCore.3x/ShardingCore.3x.csproj | 43 ---------------- src5x/ShardingCore.5x/ShardingCore.5x.csproj | 40 --------------- src6x/ShardingCore.6x/ShardingCore.6x.csproj | 38 -------------- 4 files changed, 173 deletions(-) delete mode 100644 src2x/ShardingCore.2x/ShardingCore.2x.csproj delete mode 100644 src3x/ShardingCore.3x/ShardingCore.3x.csproj delete mode 100644 src5x/ShardingCore.5x/ShardingCore.5x.csproj delete mode 100644 src6x/ShardingCore.6x/ShardingCore.6x.csproj diff --git a/src2x/ShardingCore.2x/ShardingCore.2x.csproj b/src2x/ShardingCore.2x/ShardingCore.2x.csproj deleted file mode 100644 index 161e329d..00000000 --- a/src2x/ShardingCore.2x/ShardingCore.2x.csproj +++ /dev/null @@ -1,52 +0,0 @@ - - - - - netstandard2.0 - $(EFCORE2) - true - TRACE;DEBUG;EFCORE2; - 9.0 - ShardingCore - ShardingCore - https://github.com/xuejmnet/sharding-core - - - - true - bin\Release\ShardingCore.2x.xml - - - - True - \ - - - - - - - - - - Sharding\ShardingExecutors\Abstractions\ICompileParameter.cs - - - Sharding\MergeEngines\EnumeratorStreamMergeEngines\Abstractions\AbstractStreamMergeEnumerable.cs - - - Sharding\MergeEngines\EnumeratorStreamMergeEngines\Enumerables\FirstOrDefaultStreamMergeEnumerable.cs - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src3x/ShardingCore.3x/ShardingCore.3x.csproj b/src3x/ShardingCore.3x/ShardingCore.3x.csproj deleted file mode 100644 index 6dc1ba03..00000000 --- a/src3x/ShardingCore.3x/ShardingCore.3x.csproj +++ /dev/null @@ -1,43 +0,0 @@ - - - - - netstandard2.0 - $(EFCORE3) - true - TRACE;DEBUG;EFCORE3; - 9.0 - ShardingCore - ShardingCore - https://github.com/xuejmnet/sharding-core - - - - true - bin\Release\ShardingCore.3x.xml - - - - True - \ - - - - - - - - - - EFCores\EFCore3x\ScriptMigrationGenerator.cs - - - EFCores\EFCore2x\ScriptMigrationGenerator.cs - - - - - - - - diff --git a/src5x/ShardingCore.5x/ShardingCore.5x.csproj b/src5x/ShardingCore.5x/ShardingCore.5x.csproj deleted file mode 100644 index 96c245c2..00000000 --- a/src5x/ShardingCore.5x/ShardingCore.5x.csproj +++ /dev/null @@ -1,40 +0,0 @@ - - - - netstandard2.1 - $(EFCORE5) - true - TRACE;DEBUG;EFCORE5; - 9.0 - ShardingCore - ShardingCore - https://github.com/xuejmnet/sharding-core - - - - true - bin\Release\ShardingCore.5x.xml - - - - True - \ - - - - - - - - - - Sharding\Enumerators\StreamMergeAsync\ConstantElementStreamMergeAsyncEnumerator.cs - - - - - - - - - diff --git a/src6x/ShardingCore.6x/ShardingCore.6x.csproj b/src6x/ShardingCore.6x/ShardingCore.6x.csproj deleted file mode 100644 index a840d5a2..00000000 --- a/src6x/ShardingCore.6x/ShardingCore.6x.csproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - net6.0 - $(EFCORE6) - true - TRACE;DEBUG;EFCORE6; - 9.0 - ShardingCore - ShardingCore - https://github.com/xuejmnet/sharding-core - - - - true - bin\Release\ShardingCore.6x.xml - - - - True - \ - - - - - - - - - - - - - - - -