diff --git a/ShardingCore.sln b/ShardingCore.sln index 97005a1f..f1a9460d 100644 --- a/ShardingCore.sln +++ b/ShardingCore.sln @@ -63,6 +63,22 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShardingCore.2_6", "src2_6\ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShardingCore.Test6x", "test\ShardingCore.Test6x\ShardingCore.Test6x.csproj", "{8ED3A191-5A29-4599-B383-9FD225CC0BA2}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src6", "src6", "{585A790B-8B19-430F-BEB7-9F7D1A3AAFAA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src5", "src5", "{53D07876-A791-46AE-8381-08557593693D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src2", "src2", "{B11D7DF7-A907-407E-8BF1-35B430413557}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src3", "src3", "{51E1D067-3E81-4815-94F2-F8ABBE80881E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShardingCore6", "src6\ShardingCore6\ShardingCore6.csproj", "{3F80E6C2-D0AB-409D-B200-FFB6620E956A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShardingCore5", "src5\ShardingCore5\ShardingCore5.csproj", "{E5E48D52-CAD3-42F0-82CD-A2A6180F3C4D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShardingCore3", "src3\ShardingCore3\ShardingCore3.csproj", "{B59909AD-8885-40F3-9454-6C8433463BCC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShardingCore2", "src2\ShardingCore2\ShardingCore2.csproj", "{F0393C32-2285-4F47-AC61-C1BA1CAC269D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -169,6 +185,22 @@ Global {8ED3A191-5A29-4599-B383-9FD225CC0BA2}.Debug|Any CPU.Build.0 = Debug|Any CPU {8ED3A191-5A29-4599-B383-9FD225CC0BA2}.Release|Any CPU.ActiveCfg = Release|Any CPU {8ED3A191-5A29-4599-B383-9FD225CC0BA2}.Release|Any CPU.Build.0 = Release|Any CPU + {3F80E6C2-D0AB-409D-B200-FFB6620E956A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F80E6C2-D0AB-409D-B200-FFB6620E956A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F80E6C2-D0AB-409D-B200-FFB6620E956A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F80E6C2-D0AB-409D-B200-FFB6620E956A}.Release|Any CPU.Build.0 = Release|Any CPU + {E5E48D52-CAD3-42F0-82CD-A2A6180F3C4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5E48D52-CAD3-42F0-82CD-A2A6180F3C4D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5E48D52-CAD3-42F0-82CD-A2A6180F3C4D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5E48D52-CAD3-42F0-82CD-A2A6180F3C4D}.Release|Any CPU.Build.0 = Release|Any CPU + {B59909AD-8885-40F3-9454-6C8433463BCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B59909AD-8885-40F3-9454-6C8433463BCC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B59909AD-8885-40F3-9454-6C8433463BCC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B59909AD-8885-40F3-9454-6C8433463BCC}.Release|Any CPU.Build.0 = Release|Any CPU + {F0393C32-2285-4F47-AC61-C1BA1CAC269D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F0393C32-2285-4F47-AC61-C1BA1CAC269D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F0393C32-2285-4F47-AC61-C1BA1CAC269D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0393C32-2285-4F47-AC61-C1BA1CAC269D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -199,6 +231,10 @@ Global {BF4FEA2A-3F09-47D8-9BF7-4261D8D1671D} = {EDF8869A-C1E1-491B-BC9F-4A33F4DE1C73} {B8B27249-E775-4A8F-BF64-B64C6B34DAA3} = {5C015EB7-678C-421E-BB84-30EDCCCE0AB6} {8ED3A191-5A29-4599-B383-9FD225CC0BA2} = {CC2C88C0-65F2-445D-BE78-973B840FE281} + {3F80E6C2-D0AB-409D-B200-FFB6620E956A} = {585A790B-8B19-430F-BEB7-9F7D1A3AAFAA} + {E5E48D52-CAD3-42F0-82CD-A2A6180F3C4D} = {53D07876-A791-46AE-8381-08557593693D} + {B59909AD-8885-40F3-9454-6C8433463BCC} = {51E1D067-3E81-4815-94F2-F8ABBE80881E} + {F0393C32-2285-4F47-AC61-C1BA1CAC269D} = {B11D7DF7-A907-407E-8BF1-35B430413557} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {8C07A667-E8B4-43C7-8053-721584BAD291} diff --git a/src/ShardingCore/Core/EntityMetadatas/EntityMetadataDataSourceBuilder.cs b/src/ShardingCore/Core/EntityMetadatas/EntityMetadataDataSourceBuilder.cs index 118d79c4..626a3628 100644 --- a/src/ShardingCore/Core/EntityMetadatas/EntityMetadataDataSourceBuilder.cs +++ b/src/ShardingCore/Core/EntityMetadatas/EntityMetadataDataSourceBuilder.cs @@ -5,7 +5,7 @@ using System.Text; using Microsoft.EntityFrameworkCore.Infrastructure; using ShardingCore.Extensions; -#if NETCOREAPP2_0 +#if EFCORE2 using Microsoft.EntityFrameworkCore.Internal; #endif diff --git a/src/ShardingCore/Core/EntityMetadatas/EntityMetadataTableBuilder.cs b/src/ShardingCore/Core/EntityMetadatas/EntityMetadataTableBuilder.cs index 8eb3da3e..32a429c0 100644 --- a/src/ShardingCore/Core/EntityMetadatas/EntityMetadataTableBuilder.cs +++ b/src/ShardingCore/Core/EntityMetadatas/EntityMetadataTableBuilder.cs @@ -3,7 +3,7 @@ using System.Linq.Expressions; using Microsoft.EntityFrameworkCore.Infrastructure; using ShardingCore.Extensions; -#if NETCOREAPP2_0 +#if EFCORE2 using Microsoft.EntityFrameworkCore.Internal; #endif diff --git a/src/ShardingCore/Core/IShardingModelCacheOption.cs b/src/ShardingCore/Core/IShardingModelCacheOption.cs index 2e7777d3..f3770f55 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 !NETCOREAPP2_0 +#if !EFCORE2 CacheItemPriority GetModelCachePriority(); int GetModelCacheEntrySize(); #endif diff --git a/src/ShardingCore/Core/VirtualRoutes/TableRouteUnit.cs b/src/ShardingCore/Core/VirtualRoutes/TableRouteUnit.cs index c55d74c2..d50ce7df 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 !NETCOREAPP2_0 +#if !EFCORE2 public override int GetHashCode() { @@ -33,7 +33,7 @@ namespace ShardingCore.Core.VirtualRoutes } #endif -#if NETCOREAPP2_0 +#if EFCORE2 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 e216feeb..03b96f87 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 !NETCOREAPP2_0 +#if !EFCORE2 public override int GetHashCode() { @@ -55,7 +55,7 @@ namespace ShardingCore.Core.VirtualRoutes.TableRoutes.RoutingRuleEngine } #endif -#if NETCOREAPP2_0 +#if EFCORE2 public override int GetHashCode() { diff --git a/src/ShardingCore/EFCores/EFCore2x/ScriptMigrationGenerator.cs b/src/ShardingCore/EFCores/EFCore2x/ScriptMigrationGenerator.cs index 1f4e6a2f..28c9d408 100644 --- a/src/ShardingCore/EFCores/EFCore2x/ScriptMigrationGenerator.cs +++ b/src/ShardingCore/EFCores/EFCore2x/ScriptMigrationGenerator.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP2_0&&SHARDINGCORE2_6 +#if EFCORE2&&SHARDINGCORE2_6 using Microsoft.EntityFrameworkCore.Migrations; using ShardingCore.Core.RuntimeContexts; diff --git a/src/ShardingCore/EFCores/EFCore2x/ShardingChangeTracker.cs b/src/ShardingCore/EFCores/EFCore2x/ShardingChangeTracker.cs index abf643d6..7f4dff30 100644 --- a/src/ShardingCore/EFCores/EFCore2x/ShardingChangeTracker.cs +++ b/src/ShardingCore/EFCores/EFCore2x/ShardingChangeTracker.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP2_0&&SHARDINGCORE2_6 +#if EFCORE2&&SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Linq; diff --git a/src/ShardingCore/EFCores/EFCore2x/ShardingDbSetSource.cs b/src/ShardingCore/EFCores/EFCore2x/ShardingDbSetSource.cs index e4cf51b6..57e3fcdb 100644 --- a/src/ShardingCore/EFCores/EFCore2x/ShardingDbSetSource.cs +++ b/src/ShardingCore/EFCores/EFCore2x/ShardingDbSetSource.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP2_0 && SHARDINGCORE2_6 +#if EFCORE2 && SHARDINGCORE2_6 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Internal; using System; diff --git a/src/ShardingCore/EFCores/EFCore2x/ShardingInternalDbQuery.cs b/src/ShardingCore/EFCores/EFCore2x/ShardingInternalDbQuery.cs index 38b171a2..a1549e67 100644 --- a/src/ShardingCore/EFCores/EFCore2x/ShardingInternalDbQuery.cs +++ b/src/ShardingCore/EFCores/EFCore2x/ShardingInternalDbQuery.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP2_0 && SHARDINGCORE2_6 +#if EFCORE2 && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Text; diff --git a/src/ShardingCore/EFCores/EFCore2x/ShardingInternalDbSet.cs b/src/ShardingCore/EFCores/EFCore2x/ShardingInternalDbSet.cs index 43eba354..b1b7ee19 100644 --- a/src/ShardingCore/EFCores/EFCore2x/ShardingInternalDbSet.cs +++ b/src/ShardingCore/EFCores/EFCore2x/ShardingInternalDbSet.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP2_0 && SHARDINGCORE2_6 +#if EFCORE2 && SHARDINGCORE2_6 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.Internal; diff --git a/src/ShardingCore/EFCores/EFCore2x/ShardingMigrator.cs b/src/ShardingCore/EFCores/EFCore2x/ShardingMigrator.cs index e460538a..ab940050 100644 --- a/src/ShardingCore/EFCores/EFCore2x/ShardingMigrator.cs +++ b/src/ShardingCore/EFCores/EFCore2x/ShardingMigrator.cs @@ -1,5 +1,5 @@ -#if NETCOREAPP2_0&&SHARDINGCORE2_6 +#if EFCORE2&&SHARDINGCORE2_6 using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; diff --git a/src/ShardingCore/EFCores/EFCore2x/ShardingModelSource.cs b/src/ShardingCore/EFCores/EFCore2x/ShardingModelSource.cs index d9fdecba..76642315 100644 --- a/src/ShardingCore/EFCores/EFCore2x/ShardingModelSource.cs +++ b/src/ShardingCore/EFCores/EFCore2x/ShardingModelSource.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP2_0&&SHARDINGCORE2_6 +#if EFCORE2&&SHARDINGCORE2_6 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; diff --git a/src/ShardingCore/EFCores/EFCore2x/ShardingOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore2x/ShardingOptionsExtension.cs index 6aca963b..ca99b319 100644 --- a/src/ShardingCore/EFCores/EFCore2x/ShardingOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore2x/ShardingOptionsExtension.cs @@ -1,5 +1,5 @@ -#if NETCOREAPP2_0 && SHARDINGCORE2_6 +#if EFCORE2 && SHARDINGCORE2_6 using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/src/ShardingCore/EFCores/EFCore2x/ShardingWrapOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore2x/ShardingWrapOptionsExtension.cs index 19e0d9a8..36a84b86 100644 --- a/src/ShardingCore/EFCores/EFCore2x/ShardingWrapOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore2x/ShardingWrapOptionsExtension.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP2_0 && SHARDINGCORE2_6 +#if EFCORE2 && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Text; diff --git a/src/ShardingCore/EFCores/EFCore2x/Tx/ShardingRelationalTransaction.cs b/src/ShardingCore/EFCores/EFCore2x/Tx/ShardingRelationalTransaction.cs index 9ce5bbc6..66acbe37 100644 --- a/src/ShardingCore/EFCores/EFCore2x/Tx/ShardingRelationalTransaction.cs +++ b/src/ShardingCore/EFCores/EFCore2x/Tx/ShardingRelationalTransaction.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP2_0&&SHARDINGCORE2_6 +#if EFCORE2&&SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Data.Common; diff --git a/src/ShardingCore/EFCores/EFCore2x/Tx/ShardingRelationalTransactionFactory.cs b/src/ShardingCore/EFCores/EFCore2x/Tx/ShardingRelationalTransactionFactory.cs index fdadf322..0f93d953 100644 --- a/src/ShardingCore/EFCores/EFCore2x/Tx/ShardingRelationalTransactionFactory.cs +++ b/src/ShardingCore/EFCores/EFCore2x/Tx/ShardingRelationalTransactionFactory.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP2_0 && SHARDINGCORE2_6 +#if EFCORE2 && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Data.Common; diff --git a/src/ShardingCore/EFCores/EFCore2x/Tx/ShardingRelationalTransactionManager.cs b/src/ShardingCore/EFCores/EFCore2x/Tx/ShardingRelationalTransactionManager.cs index 9031ef81..2b33517f 100644 --- a/src/ShardingCore/EFCores/EFCore2x/Tx/ShardingRelationalTransactionManager.cs +++ b/src/ShardingCore/EFCores/EFCore2x/Tx/ShardingRelationalTransactionManager.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP2_0 && SHARDINGCORE2_6 +#if EFCORE2 && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Data; diff --git a/src/ShardingCore/EFCores/EFCore2x/UnionAllMergeOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore2x/UnionAllMergeOptionsExtension.cs index ba870e3f..669c7887 100644 --- a/src/ShardingCore/EFCores/EFCore2x/UnionAllMergeOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore2x/UnionAllMergeOptionsExtension.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP2_0 && SHARDINGCORE2_6 +#if EFCORE2 && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Text; diff --git a/src/ShardingCore/EFCores/EFCore3x/ScriptMigrationGenerator.cs b/src/ShardingCore/EFCores/EFCore3x/ScriptMigrationGenerator.cs index 8704b5f7..01e02a19 100644 --- a/src/ShardingCore/EFCores/EFCore3x/ScriptMigrationGenerator.cs +++ b/src/ShardingCore/EFCores/EFCore3x/ScriptMigrationGenerator.cs @@ -1,4 +1,4 @@ -#if (NETCOREAPP3_0 || NETSTANDARD2_0 )&&SHARDINGCORE2_6 +#if (EFCORE3 || NETSTANDARD2_0 )&&SHARDINGCORE2_6 using Microsoft.EntityFrameworkCore.Migrations; using ShardingCore.Core.RuntimeContexts; diff --git a/src/ShardingCore/EFCores/EFCore3x/ShardingChangeTracker.cs b/src/ShardingCore/EFCores/EFCore3x/ShardingChangeTracker.cs index 1d565221..ae638799 100644 --- a/src/ShardingCore/EFCores/EFCore3x/ShardingChangeTracker.cs +++ b/src/ShardingCore/EFCores/EFCore3x/ShardingChangeTracker.cs @@ -1,4 +1,4 @@ -#if (NETCOREAPP3_0 || NETSTANDARD2_0 )&&SHARDINGCORE2_6 +#if (EFCORE3 || NETSTANDARD2_0 )&&SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Linq; diff --git a/src/ShardingCore/EFCores/EFCore3x/ShardingDbSetSource.cs b/src/ShardingCore/EFCores/EFCore3x/ShardingDbSetSource.cs index 2a289b61..3d235346 100644 --- a/src/ShardingCore/EFCores/EFCore3x/ShardingDbSetSource.cs +++ b/src/ShardingCore/EFCores/EFCore3x/ShardingDbSetSource.cs @@ -1,4 +1,4 @@ -#if (NETCOREAPP3_0 || NETSTANDARD2_0) && SHARDINGCORE2_6 +#if (EFCORE3 || NETSTANDARD2_0) && SHARDINGCORE2_6 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Internal; using System; diff --git a/src/ShardingCore/EFCores/EFCore3x/ShardingInternalDbSet.cs b/src/ShardingCore/EFCores/EFCore3x/ShardingInternalDbSet.cs index c9489220..0c9371c8 100644 --- a/src/ShardingCore/EFCores/EFCore3x/ShardingInternalDbSet.cs +++ b/src/ShardingCore/EFCores/EFCore3x/ShardingInternalDbSet.cs @@ -1,4 +1,4 @@ -#if (NETCOREAPP3_0 || NETSTANDARD2_0) && SHARDINGCORE2_6 +#if (EFCORE3 || NETSTANDARD2_0) && SHARDINGCORE2_6 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.Internal; diff --git a/src/ShardingCore/EFCores/EFCore3x/ShardingMigrator.cs b/src/ShardingCore/EFCores/EFCore3x/ShardingMigrator.cs index f43a14c4..769f862b 100644 --- a/src/ShardingCore/EFCores/EFCore3x/ShardingMigrator.cs +++ b/src/ShardingCore/EFCores/EFCore3x/ShardingMigrator.cs @@ -1,5 +1,5 @@ -#if (NETCOREAPP3_0 || NETSTANDARD2_0)&&SHARDINGCORE2_6 +#if (EFCORE3 || NETSTANDARD2_0)&&SHARDINGCORE2_6 using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; diff --git a/src/ShardingCore/EFCores/EFCore3x/ShardingModelSource.cs b/src/ShardingCore/EFCores/EFCore3x/ShardingModelSource.cs index 3a07a231..a1de0d28 100644 --- a/src/ShardingCore/EFCores/EFCore3x/ShardingModelSource.cs +++ b/src/ShardingCore/EFCores/EFCore3x/ShardingModelSource.cs @@ -1,4 +1,4 @@ -#if (NETCOREAPP3_0 || NETSTANDARD2_0)&&SHARDINGCORE2_6 +#if (EFCORE3 || NETSTANDARD2_0)&&SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Linq; diff --git a/src/ShardingCore/EFCores/EFCore3x/ShardingOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore3x/ShardingOptionsExtension.cs index 5c3d0107..a9cc4fcb 100644 --- a/src/ShardingCore/EFCores/EFCore3x/ShardingOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore3x/ShardingOptionsExtension.cs @@ -1,4 +1,4 @@ -#if (NETCOREAPP3_0 || NETSTANDARD2_0)&&SHARDINGCORE2_6 +#if (EFCORE3 || NETSTANDARD2_0)&&SHARDINGCORE2_6 using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/src/ShardingCore/EFCores/EFCore3x/ShardingWrapOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore3x/ShardingWrapOptionsExtension.cs index afc92e05..bdc6c5c9 100644 --- a/src/ShardingCore/EFCores/EFCore3x/ShardingWrapOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore3x/ShardingWrapOptionsExtension.cs @@ -1,4 +1,4 @@ -#if (NETCOREAPP3_0 || NETSTANDARD2_0) && SHARDINGCORE2_6 +#if (EFCORE3 || NETSTANDARD2_0) && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Text; diff --git a/src/ShardingCore/EFCores/EFCore3x/Tx/ShardingRelationalTransaction.cs b/src/ShardingCore/EFCores/EFCore3x/Tx/ShardingRelationalTransaction.cs index fd9af368..e06ce840 100644 --- a/src/ShardingCore/EFCores/EFCore3x/Tx/ShardingRelationalTransaction.cs +++ b/src/ShardingCore/EFCores/EFCore3x/Tx/ShardingRelationalTransaction.cs @@ -1,4 +1,4 @@ -#if (NETCOREAPP3_0 || NETSTANDARD2_0)&&SHARDINGCORE2_6 +#if (EFCORE3 || NETSTANDARD2_0)&&SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Data.Common; @@ -52,7 +52,7 @@ namespace ShardingCore.EFCores _shardingDbContextExecutor.NotifyShardingTransaction(); } -#if !NETCOREAPP2_0 +#if !EFCORE2 public override async Task RollbackAsync(CancellationToken cancellationToken = new CancellationToken()) { await base.RollbackAsync(cancellationToken); diff --git a/src/ShardingCore/EFCores/EFCore3x/Tx/ShardingRelationalTransactionFactory.cs b/src/ShardingCore/EFCores/EFCore3x/Tx/ShardingRelationalTransactionFactory.cs index b4d6c20d..1d194f13 100644 --- a/src/ShardingCore/EFCores/EFCore3x/Tx/ShardingRelationalTransactionFactory.cs +++ b/src/ShardingCore/EFCores/EFCore3x/Tx/ShardingRelationalTransactionFactory.cs @@ -1,4 +1,4 @@ -#if (NETCOREAPP3_0 || NETSTANDARD2_0) && SHARDINGCORE2_6 +#if (EFCORE3 || NETSTANDARD2_0) && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Data.Common; diff --git a/src/ShardingCore/EFCores/EFCore3x/Tx/ShardingRelationalTransactionManager.cs b/src/ShardingCore/EFCores/EFCore3x/Tx/ShardingRelationalTransactionManager.cs index 805df3b6..5303c45c 100644 --- a/src/ShardingCore/EFCores/EFCore3x/Tx/ShardingRelationalTransactionManager.cs +++ b/src/ShardingCore/EFCores/EFCore3x/Tx/ShardingRelationalTransactionManager.cs @@ -1,4 +1,4 @@ -#if (NETCOREAPP3_0 || NETSTANDARD2_0) && SHARDINGCORE2_6 +#if (EFCORE3 || NETSTANDARD2_0) && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Data; diff --git a/src/ShardingCore/EFCores/EFCore3x/UnionAllMergeOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore3x/UnionAllMergeOptionsExtension.cs index 78ee1299..cf92d6b3 100644 --- a/src/ShardingCore/EFCores/EFCore3x/UnionAllMergeOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore3x/UnionAllMergeOptionsExtension.cs @@ -1,4 +1,4 @@ -#if (NETCOREAPP3_0 || NETSTANDARD2_0) && SHARDINGCORE2_6 +#if (EFCORE3 || NETSTANDARD2_0) && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Text; diff --git a/src/ShardingCore/EFCores/EFCore5x/ScriptMigrationGenerator.cs b/src/ShardingCore/EFCores/EFCore5x/ScriptMigrationGenerator.cs index 7e553f64..36e8be8a 100644 --- a/src/ShardingCore/EFCores/EFCore5x/ScriptMigrationGenerator.cs +++ b/src/ShardingCore/EFCores/EFCore5x/ScriptMigrationGenerator.cs @@ -1,4 +1,4 @@ -#if (NET5_0 || NETSTANDARD2_1)&&SHARDINGCORE2_6 +#if (EFCORE5 || NETSTANDARD2_1)&&SHARDINGCORE2_6 using Microsoft.EntityFrameworkCore.Migrations; using ShardingCore.Core.RuntimeContexts; diff --git a/src/ShardingCore/EFCores/EFCore5x/ShardingChangeTracker.cs b/src/ShardingCore/EFCores/EFCore5x/ShardingChangeTracker.cs index 52451c4c..adfb2aa5 100644 --- a/src/ShardingCore/EFCores/EFCore5x/ShardingChangeTracker.cs +++ b/src/ShardingCore/EFCores/EFCore5x/ShardingChangeTracker.cs @@ -1,4 +1,4 @@ -#if (NET5_0 || NETSTANDARD2_1)&&SHARDINGCORE2_6 +#if (EFCORE5 || NETSTANDARD2_1)&&SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Linq; diff --git a/src/ShardingCore/EFCores/EFCore5x/ShardingDbSetSource.cs b/src/ShardingCore/EFCores/EFCore5x/ShardingDbSetSource.cs index 7f0e9f5d..49ab89e0 100644 --- a/src/ShardingCore/EFCores/EFCore5x/ShardingDbSetSource.cs +++ b/src/ShardingCore/EFCores/EFCore5x/ShardingDbSetSource.cs @@ -1,4 +1,4 @@ -#if (NET5_0 || NETSTANDARD2_1 ) && SHARDINGCORE2_6 +#if (EFCORE5 || NETSTANDARD2_1 ) && SHARDINGCORE2_6 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Internal; using System; diff --git a/src/ShardingCore/EFCores/EFCore5x/ShardingInternalDbSet.cs b/src/ShardingCore/EFCores/EFCore5x/ShardingInternalDbSet.cs index d75780b7..78279050 100644 --- a/src/ShardingCore/EFCores/EFCore5x/ShardingInternalDbSet.cs +++ b/src/ShardingCore/EFCores/EFCore5x/ShardingInternalDbSet.cs @@ -1,4 +1,4 @@ -#if (NET5_0 || NETSTANDARD2_1 ) && SHARDINGCORE2_6 +#if (EFCORE5 || NETSTANDARD2_1 ) && SHARDINGCORE2_6 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.Internal; diff --git a/src/ShardingCore/EFCores/EFCore5x/ShardingMigrator.cs b/src/ShardingCore/EFCores/EFCore5x/ShardingMigrator.cs index c2d297cc..4fb9ba02 100644 --- a/src/ShardingCore/EFCores/EFCore5x/ShardingMigrator.cs +++ b/src/ShardingCore/EFCores/EFCore5x/ShardingMigrator.cs @@ -1,5 +1,5 @@ -#if (NET5_0 || NETSTANDARD2_1)&&SHARDINGCORE2_6 +#if (EFCORE5 || NETSTANDARD2_1)&&SHARDINGCORE2_6 using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; diff --git a/src/ShardingCore/EFCores/EFCore5x/ShardingModelSource.cs b/src/ShardingCore/EFCores/EFCore5x/ShardingModelSource.cs index 2afed500..3f11238f 100644 --- a/src/ShardingCore/EFCores/EFCore5x/ShardingModelSource.cs +++ b/src/ShardingCore/EFCores/EFCore5x/ShardingModelSource.cs @@ -1,4 +1,4 @@ -#if (NET5_0 || NETSTANDARD2_1)&&SHARDINGCORE2_6 +#if (EFCORE5 || NETSTANDARD2_1)&&SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/src/ShardingCore/EFCores/EFCore5x/ShardingOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore5x/ShardingOptionsExtension.cs index a6e984fb..17a2227f 100644 --- a/src/ShardingCore/EFCores/EFCore5x/ShardingOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore5x/ShardingOptionsExtension.cs @@ -1,4 +1,4 @@ -#if (NET5_0 || NETSTANDARD2_1) && SHARDINGCORE2_6 +#if (EFCORE5 || NETSTANDARD2_1) && SHARDINGCORE2_6 using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/src/ShardingCore/EFCores/EFCore5x/ShardingWrapOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore5x/ShardingWrapOptionsExtension.cs index 193cb799..ccd4d12b 100644 --- a/src/ShardingCore/EFCores/EFCore5x/ShardingWrapOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore5x/ShardingWrapOptionsExtension.cs @@ -1,4 +1,4 @@ -#if (NET5_0 || NETSTANDARD2_1) && SHARDINGCORE2_6 +#if (EFCORE5 || NETSTANDARD2_1) && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Text; diff --git a/src/ShardingCore/EFCores/EFCore5x/Tx/ShardingRelationalTransaction.cs b/src/ShardingCore/EFCores/EFCore5x/Tx/ShardingRelationalTransaction.cs index 828ab689..7536721a 100644 --- a/src/ShardingCore/EFCores/EFCore5x/Tx/ShardingRelationalTransaction.cs +++ b/src/ShardingCore/EFCores/EFCore5x/Tx/ShardingRelationalTransaction.cs @@ -1,4 +1,4 @@ -#if (NET5_0 || NETSTANDARD2_1)&&SHARDINGCORE2_6 +#if (EFCORE5 || NETSTANDARD2_1)&&SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Data.Common; diff --git a/src/ShardingCore/EFCores/EFCore5x/Tx/ShardingRelationalTransactionFactory.cs b/src/ShardingCore/EFCores/EFCore5x/Tx/ShardingRelationalTransactionFactory.cs index 3a52e2f0..03c0149f 100644 --- a/src/ShardingCore/EFCores/EFCore5x/Tx/ShardingRelationalTransactionFactory.cs +++ b/src/ShardingCore/EFCores/EFCore5x/Tx/ShardingRelationalTransactionFactory.cs @@ -1,4 +1,4 @@ -#if (NET5_0 || NETSTANDARD2_1) && SHARDINGCORE2_6 +#if (EFCORE5 || NETSTANDARD2_1) && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Data.Common; diff --git a/src/ShardingCore/EFCores/EFCore5x/Tx/ShardingRelationalTransactionManager.cs b/src/ShardingCore/EFCores/EFCore5x/Tx/ShardingRelationalTransactionManager.cs index 64481077..d63d91b8 100644 --- a/src/ShardingCore/EFCores/EFCore5x/Tx/ShardingRelationalTransactionManager.cs +++ b/src/ShardingCore/EFCores/EFCore5x/Tx/ShardingRelationalTransactionManager.cs @@ -1,4 +1,4 @@ -#if (NET5_0 || NETSTANDARD2_1) && SHARDINGCORE2_6 +#if (EFCORE5 || NETSTANDARD2_1) && SHARDINGCORE2_6 using System; using System.Collections.Generic; diff --git a/src/ShardingCore/EFCores/EFCore5x/UnionAllMergeOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore5x/UnionAllMergeOptionsExtension.cs index f48e0902..f4377528 100644 --- a/src/ShardingCore/EFCores/EFCore5x/UnionAllMergeOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore5x/UnionAllMergeOptionsExtension.cs @@ -1,4 +1,4 @@ -#if (NET5_0 || NETSTANDARD2_1) && SHARDINGCORE2_6 +#if (EFCORE5 || NETSTANDARD2_1) && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Text; diff --git a/src/ShardingCore/EFCores/EFCore6x/ScriptMigrationGenerator.cs b/src/ShardingCore/EFCores/EFCore6x/ScriptMigrationGenerator.cs index 3412d11a..ccb6bae1 100644 --- a/src/ShardingCore/EFCores/EFCore6x/ScriptMigrationGenerator.cs +++ b/src/ShardingCore/EFCores/EFCore6x/ScriptMigrationGenerator.cs @@ -1,4 +1,4 @@ -#if NET6_0&&SHARDINGCORE2_6 +#if EFCORE6&&SHARDINGCORE2_6 using Microsoft.EntityFrameworkCore.Migrations; using ShardingCore.Core.RuntimeContexts; diff --git a/src/ShardingCore/EFCores/EFCore6x/ShardingChangeTracker.cs b/src/ShardingCore/EFCores/EFCore6x/ShardingChangeTracker.cs index 80be06b1..6840f855 100644 --- a/src/ShardingCore/EFCores/EFCore6x/ShardingChangeTracker.cs +++ b/src/ShardingCore/EFCores/EFCore6x/ShardingChangeTracker.cs @@ -1,4 +1,4 @@ -#if NET6_0&&SHARDINGCORE2_6 +#if EFCORE6&&SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Linq; diff --git a/src/ShardingCore/EFCores/EFCore6x/ShardingDbSetSource.cs b/src/ShardingCore/EFCores/EFCore6x/ShardingDbSetSource.cs index 96c40d89..d4db4bda 100644 --- a/src/ShardingCore/EFCores/EFCore6x/ShardingDbSetSource.cs +++ b/src/ShardingCore/EFCores/EFCore6x/ShardingDbSetSource.cs @@ -1,4 +1,4 @@ -#if NET6_0 && SHARDINGCORE2_6 +#if EFCORE6 && SHARDINGCORE2_6 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Internal; using System; diff --git a/src/ShardingCore/EFCores/EFCore6x/ShardingInternalDbSet.cs b/src/ShardingCore/EFCores/EFCore6x/ShardingInternalDbSet.cs index 6b227177..70768135 100644 --- a/src/ShardingCore/EFCores/EFCore6x/ShardingInternalDbSet.cs +++ b/src/ShardingCore/EFCores/EFCore6x/ShardingInternalDbSet.cs @@ -1,4 +1,4 @@ -#if NET6_0 && SHARDINGCORE2_6 +#if EFCORE6 && SHARDINGCORE2_6 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.Internal; diff --git a/src/ShardingCore/EFCores/EFCore6x/ShardingMigrator.cs b/src/ShardingCore/EFCores/EFCore6x/ShardingMigrator.cs index ef934289..d475a2c1 100644 --- a/src/ShardingCore/EFCores/EFCore6x/ShardingMigrator.cs +++ b/src/ShardingCore/EFCores/EFCore6x/ShardingMigrator.cs @@ -1,5 +1,5 @@ -#if NET6_0&&SHARDINGCORE2_6 +#if EFCORE6&&SHARDINGCORE2_6 using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; diff --git a/src/ShardingCore/EFCores/EFCore6x/ShardingModelSource.cs b/src/ShardingCore/EFCores/EFCore6x/ShardingModelSource.cs index 3eb4b4e9..d0950ae4 100644 --- a/src/ShardingCore/EFCores/EFCore6x/ShardingModelSource.cs +++ b/src/ShardingCore/EFCores/EFCore6x/ShardingModelSource.cs @@ -1,5 +1,5 @@  -#if NET6_0&&SHARDINGCORE2_6 +#if EFCORE6&&SHARDINGCORE2_6 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; diff --git a/src/ShardingCore/EFCores/EFCore6x/ShardingOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore6x/ShardingOptionsExtension.cs index 41ccdb71..ff11fc66 100644 --- a/src/ShardingCore/EFCores/EFCore6x/ShardingOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore6x/ShardingOptionsExtension.cs @@ -1,4 +1,4 @@ -#if NET6_0 && SHARDINGCORE2_6 +#if EFCORE6 && SHARDINGCORE2_6 using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/src/ShardingCore/EFCores/EFCore6x/ShardingWrapOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore6x/ShardingWrapOptionsExtension.cs index fb9aadb6..8e6ddf73 100644 --- a/src/ShardingCore/EFCores/EFCore6x/ShardingWrapOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore6x/ShardingWrapOptionsExtension.cs @@ -1,4 +1,4 @@ -#if NET6_0 && SHARDINGCORE2_6 +#if EFCORE6 && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Text; diff --git a/src/ShardingCore/EFCores/EFCore6x/Tx/ShardingRelationalTransaction.cs b/src/ShardingCore/EFCores/EFCore6x/Tx/ShardingRelationalTransaction.cs index ad0018a4..b6d9cde4 100644 --- a/src/ShardingCore/EFCores/EFCore6x/Tx/ShardingRelationalTransaction.cs +++ b/src/ShardingCore/EFCores/EFCore6x/Tx/ShardingRelationalTransaction.cs @@ -1,4 +1,4 @@ -#if NET6_0&&SHARDINGCORE2_6 +#if EFCORE6&&SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Data.Common; diff --git a/src/ShardingCore/EFCores/EFCore6x/Tx/ShardingRelationalTransactionFactory.cs b/src/ShardingCore/EFCores/EFCore6x/Tx/ShardingRelationalTransactionFactory.cs index 83e3ea22..c1461807 100644 --- a/src/ShardingCore/EFCores/EFCore6x/Tx/ShardingRelationalTransactionFactory.cs +++ b/src/ShardingCore/EFCores/EFCore6x/Tx/ShardingRelationalTransactionFactory.cs @@ -1,4 +1,4 @@ -#if NET6_0 && SHARDINGCORE2_6 +#if EFCORE6 && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Data.Common; diff --git a/src/ShardingCore/EFCores/EFCore6x/Tx/ShardingRelationalTransactionManager.cs b/src/ShardingCore/EFCores/EFCore6x/Tx/ShardingRelationalTransactionManager.cs index 5f7ee318..12c869eb 100644 --- a/src/ShardingCore/EFCores/EFCore6x/Tx/ShardingRelationalTransactionManager.cs +++ b/src/ShardingCore/EFCores/EFCore6x/Tx/ShardingRelationalTransactionManager.cs @@ -1,4 +1,4 @@ -#if NET6_0 && SHARDINGCORE2_6 +#if EFCORE6 && SHARDINGCORE2_6 using System; using System.Collections.Generic; diff --git a/src/ShardingCore/EFCores/EFCore6x/UnionAllMergeOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore6x/UnionAllMergeOptionsExtension.cs index bb698fef..4f6b78bf 100644 --- a/src/ShardingCore/EFCores/EFCore6x/UnionAllMergeOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore6x/UnionAllMergeOptionsExtension.cs @@ -1,4 +1,4 @@ -#if NET6_0 && SHARDINGCORE2_6 +#if EFCORE6 && SHARDINGCORE2_6 using System; using System.Collections.Generic; using System.Text; diff --git a/src/ShardingCore/EFCores/EFCore7x/ScriptMigrationGenerator.cs b/src/ShardingCore/EFCores/EFCore7x/ScriptMigrationGenerator.cs index de411e43..c4f8e010 100644 --- a/src/ShardingCore/EFCores/EFCore7x/ScriptMigrationGenerator.cs +++ b/src/ShardingCore/EFCores/EFCore7x/ScriptMigrationGenerator.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using Microsoft.EntityFrameworkCore.Migrations; using ShardingCore.Core.RuntimeContexts; diff --git a/src/ShardingCore/EFCores/EFCore7x/ShardingChangeTracker.cs b/src/ShardingCore/EFCores/EFCore7x/ShardingChangeTracker.cs index b289f083..88134fa3 100644 --- a/src/ShardingCore/EFCores/EFCore7x/ShardingChangeTracker.cs +++ b/src/ShardingCore/EFCores/EFCore7x/ShardingChangeTracker.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using System; using System.Collections.Generic; using System.Linq; diff --git a/src/ShardingCore/EFCores/EFCore7x/ShardingDbSetSource.cs b/src/ShardingCore/EFCores/EFCore7x/ShardingDbSetSource.cs index 0875fda7..f7848a76 100644 --- a/src/ShardingCore/EFCores/EFCore7x/ShardingDbSetSource.cs +++ b/src/ShardingCore/EFCores/EFCore7x/ShardingDbSetSource.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Internal; diff --git a/src/ShardingCore/EFCores/EFCore7x/ShardingInternalDbSet.cs b/src/ShardingCore/EFCores/EFCore7x/ShardingInternalDbSet.cs index 92e40d57..73266cbc 100644 --- a/src/ShardingCore/EFCores/EFCore7x/ShardingInternalDbSet.cs +++ b/src/ShardingCore/EFCores/EFCore7x/ShardingInternalDbSet.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.Internal; diff --git a/src/ShardingCore/EFCores/EFCore7x/ShardingMigrator.cs b/src/ShardingCore/EFCores/EFCore7x/ShardingMigrator.cs index 2ed201df..5cbb1bc2 100644 --- a/src/ShardingCore/EFCores/EFCore7x/ShardingMigrator.cs +++ b/src/ShardingCore/EFCores/EFCore7x/ShardingMigrator.cs @@ -1,5 +1,5 @@ -#if SHARDINGCORE7 +#if EFCORE7 using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; diff --git a/src/ShardingCore/EFCores/EFCore7x/ShardingModelSource.cs b/src/ShardingCore/EFCores/EFCore7x/ShardingModelSource.cs index 76833318..2e2d16e6 100644 --- a/src/ShardingCore/EFCores/EFCore7x/ShardingModelSource.cs +++ b/src/ShardingCore/EFCores/EFCore7x/ShardingModelSource.cs @@ -1,5 +1,5 @@  -#if SHARDINGCORE7 +#if EFCORE7 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; diff --git a/src/ShardingCore/EFCores/EFCore7x/ShardingOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore7x/ShardingOptionsExtension.cs index 82e48949..c3f60cdb 100644 --- a/src/ShardingCore/EFCores/EFCore7x/ShardingOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore7x/ShardingOptionsExtension.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using System; using System.Collections.Generic; diff --git a/src/ShardingCore/EFCores/EFCore7x/ShardingWrapOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore7x/ShardingWrapOptionsExtension.cs index b851e65e..58fd50a3 100644 --- a/src/ShardingCore/EFCores/EFCore7x/ShardingWrapOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore7x/ShardingWrapOptionsExtension.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using System; using System.Collections.Generic; diff --git a/src/ShardingCore/EFCores/EFCore7x/Tx/ShardingRelationalTransaction.cs b/src/ShardingCore/EFCores/EFCore7x/Tx/ShardingRelationalTransaction.cs index 4cf34f7e..3dd1a266 100644 --- a/src/ShardingCore/EFCores/EFCore7x/Tx/ShardingRelationalTransaction.cs +++ b/src/ShardingCore/EFCores/EFCore7x/Tx/ShardingRelationalTransaction.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using System; using System.Collections.Generic; using System.Data.Common; diff --git a/src/ShardingCore/EFCores/EFCore7x/Tx/ShardingRelationalTransactionFactory.cs b/src/ShardingCore/EFCores/EFCore7x/Tx/ShardingRelationalTransactionFactory.cs index 01deb643..59e1079e 100644 --- a/src/ShardingCore/EFCores/EFCore7x/Tx/ShardingRelationalTransactionFactory.cs +++ b/src/ShardingCore/EFCores/EFCore7x/Tx/ShardingRelationalTransactionFactory.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using System; using System.Collections.Generic; using System.Data.Common; diff --git a/src/ShardingCore/EFCores/EFCore7x/Tx/ShardingRelationalTransactionManager.cs b/src/ShardingCore/EFCores/EFCore7x/Tx/ShardingRelationalTransactionManager.cs index 33690b20..7cca8b72 100644 --- a/src/ShardingCore/EFCores/EFCore7x/Tx/ShardingRelationalTransactionManager.cs +++ b/src/ShardingCore/EFCores/EFCore7x/Tx/ShardingRelationalTransactionManager.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using System; using System.Collections.Generic; using System.Data; diff --git a/src/ShardingCore/EFCores/EFCore7x/UnionAllMergeOptionsExtension.cs b/src/ShardingCore/EFCores/EFCore7x/UnionAllMergeOptionsExtension.cs index b2c8ea1f..9e6c80f1 100644 --- a/src/ShardingCore/EFCores/EFCore7x/UnionAllMergeOptionsExtension.cs +++ b/src/ShardingCore/EFCores/EFCore7x/UnionAllMergeOptionsExtension.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using System; using System.Collections.Generic; diff --git a/src/ShardingCore/EFCores/ShardingQueryCompiler.cs b/src/ShardingCore/EFCores/ShardingQueryCompiler.cs index 1bf99d22..4d036306 100644 --- a/src/ShardingCore/EFCores/ShardingQueryCompiler.cs +++ b/src/ShardingCore/EFCores/ShardingQueryCompiler.cs @@ -28,7 +28,7 @@ namespace ShardingCore.EFCores private readonly IShardingDbContext _shardingDbContext; private readonly IShardingCompilerExecutor _shardingCompilerExecutor; // -#if !NETCOREAPP2_0 +#if !EFCORE2 public ShardingQueryCompiler(IShardingRuntimeContext shardingRuntimeContext,IQueryContextFactory queryContextFactory, ICompiledQueryCache compiledQueryCache, ICompiledQueryCacheKeyGenerator compiledQueryCacheKeyGenerator, IDatabase database, IDiagnosticsLogger logger, ICurrentDbContext currentContext, IEvaluatableExpressionFilter evaluatableExpressionFilter, IModel model) : base(queryContextFactory, compiledQueryCache, compiledQueryCacheKeyGenerator, database, logger, currentContext, evaluatableExpressionFilter, model) { @@ -37,7 +37,7 @@ namespace ShardingCore.EFCores _shardingCompilerExecutor = shardingRuntimeContext.GetShardingCompilerExecutor(); } #endif -#if NETCOREAPP2_0 +#if EFCORE2 public ShardingQueryCompiler(IShardingRuntimeContext shardingRuntimeContext,IQueryContextFactory queryContextFactory, ICompiledQueryCache compiledQueryCache, ICompiledQueryCacheKeyGenerator compiledQueryCacheKeyGenerator, IDatabase database, IDiagnosticsLogger logger, ICurrentDbContext currentContext, IQueryModelGenerator queryModelGenerator) @@ -62,7 +62,7 @@ namespace ShardingCore.EFCores } -#if !NETCOREAPP2_0 +#if !EFCORE2 public override TResult ExecuteAsync(Expression query, CancellationToken cancellationToken) { @@ -83,7 +83,7 @@ namespace ShardingCore.EFCores #endif -#if NETCOREAPP2_0 +#if EFCORE2 public override IAsyncEnumerable ExecuteAsync(Expression query) { return _shardingCompilerExecutor.ExecuteAsync(_shardingDbContext, query); diff --git a/src/ShardingCore/Extensions/DbContextExtensions/DbContextExtensionShardingCore2_6.cs b/src/ShardingCore/Extensions/DbContextExtensions/DbContextExtensionShardingCore2_6.cs index f0d6eec0..5b00eb16 100644 --- a/src/ShardingCore/Extensions/DbContextExtensions/DbContextExtensionShardingCore2_6.cs +++ b/src/ShardingCore/Extensions/DbContextExtensions/DbContextExtensionShardingCore2_6.cs @@ -33,21 +33,21 @@ namespace ShardingCore.Extensions /// public static void RemoveDbContextRelationModelThatIsShardingTable(this DbContext dbContext) { -#if !NETCOREAPP2_0 && !NETSTANDARD2_0 && !NETCOREAPP3_0 && !NETSTANDARD2_1 && !NET5_0 && !NET6_0 +#if !EFCORE2 && !NETSTANDARD2_0 && !EFCORE3 && !NETSTANDARD2_1 && !EFCORE5 && !EFCORE6 throw new NotImplementedException(); #endif -#if NET6_0 +#if EFCORE6 var contextModel = dbContext.GetService().Model; ; #endif -#if NETCOREAPP2_0 || NETSTANDARD2_0 || NETCOREAPP3_0 || NET5_0 || NETSTANDARD2_1 +#if EFCORE2 || NETSTANDARD2_0 || EFCORE3 || EFCORE5 || NETSTANDARD2_1 var contextModel = dbContext.Model as Model; #endif var shardingRuntimeContext = dbContext.GetShardingRuntimeContext(); var entityMetadataManager = shardingRuntimeContext.GetEntityMetadataManager(); -#if NET6_0 +#if EFCORE6 var entityTypes = contextModel.GetEntityTypes(); foreach (var entityType in entityTypes) { @@ -64,7 +64,7 @@ namespace ShardingCore.Extensions contextModelRelationalModel.Tables.Remove(valueTuples[i]); } #endif -#if NET5_0 || NETSTANDARD2_1 +#if EFCORE5 || NETSTANDARD2_1 var entityTypes = contextModel.GetEntityTypes(); foreach (var entityType in entityTypes) { @@ -81,7 +81,7 @@ namespace ShardingCore.Extensions contextModelRelationalModel.Tables.Remove(valueTuples[i]); } #endif -#if NETCOREAPP2_0 || NETSTANDARD2_0 || NETCOREAPP3_0 +#if EFCORE2 || NETSTANDARD2_0 || EFCORE3 var entityTypes = contextModel.GetFieldValue("_entityTypes") as SortedDictionary; foreach (var entityType in entityTypes) @@ -105,23 +105,23 @@ namespace ShardingCore.Extensions // /// // public static void RemoveDbContextAllRelationModel(this DbContext dbContext) // { - //#if NET6_0 + //#if EFCORE6 // var contextModel = dbContext.GetService().Model; ; //#endif - //#if NETCOREAPP2_0 || NETCOREAPP3_0 || NET5_0 + //#if EFCORE2 || EFCORE3 || EFCORE5 // var contextModel = dbContext.Model as Model; //#endif - //#if NET6_0 + //#if EFCORE6 // var contextModelRelationalModel = contextModel.GetRelationalModel() as RelationalModel; // contextModelRelationalModel.Tables.Clear(); //#endif - //#if NET5_0 + //#if EFCORE5 // var contextModelRelationalModel = contextModel.RelationalModel as RelationalModel; // contextModelRelationalModel.Tables.Clear(); //#endif - //#if NETCOREAPP2_0 || NETCOREAPP3_0 + //#if EFCORE2 || EFCORE3 // var entityTypes = // contextModel.GetFieldValue("_entityTypes") as SortedDictionary; // entityTypes.Clear(); @@ -133,21 +133,21 @@ namespace ShardingCore.Extensions /// public static void RemoveDbContextAllRelationModelWithoutShardingDataSourceOnly(this DbContext dbContext) { -#if !NETCOREAPP2_0 && !NETSTANDARD2_0 && !NETCOREAPP3_0 && !NETSTANDARD2_1 && !NET5_0 && !NET6_0 +#if !EFCORE2 && !NETSTANDARD2_0 && !EFCORE3 && !NETSTANDARD2_1 && !EFCORE5 && !EFCORE6 throw new NotImplementedException(); #endif -#if NET6_0 +#if EFCORE6 var contextModel = dbContext.GetService().Model; ; #endif -#if NETCOREAPP2_0 || NETCOREAPP3_0 || NETSTANDARD2_0 || NET5_0 || NETSTANDARD2_1 +#if EFCORE2 || EFCORE3 || NETSTANDARD2_0 || EFCORE5 || NETSTANDARD2_1 var contextModel = dbContext.Model as Model; #endif var shardingRuntimeContext = dbContext.GetShardingRuntimeContext(); var entityMetadataManager = shardingRuntimeContext.GetEntityMetadataManager(); -#if NET6_0 +#if EFCORE6 var entityTypes = contextModel.GetEntityTypes(); foreach (var entityType in entityTypes) { @@ -164,7 +164,7 @@ namespace ShardingCore.Extensions contextModelRelationalModel.Tables.Remove(valueTuples[i]); } #endif -#if NET5_0 || NETSTANDARD2_1 +#if EFCORE5 || NETSTANDARD2_1 var entityTypes = contextModel.GetEntityTypes(); foreach (var entityType in entityTypes) { @@ -181,7 +181,7 @@ namespace ShardingCore.Extensions contextModelRelationalModel.Tables.Remove(valueTuples[i]); } #endif -#if NETCOREAPP2_0 || NETSTANDARD2_0 || NETCOREAPP3_0 +#if EFCORE2 || NETSTANDARD2_0 || EFCORE3 var entityTypes = contextModel.GetFieldValue("_entityTypes") as SortedDictionary; @@ -205,27 +205,27 @@ namespace ShardingCore.Extensions /// public static void RemoveDbContextAllRelationModel(this DbContext dbContext) { -#if !NETCOREAPP2_0 && !NETSTANDARD2_0 && !NETCOREAPP3_0 && !NETSTANDARD2_1 && !NET5_0 && !NET6_0 +#if !EFCORE2 && !NETSTANDARD2_0 && !EFCORE3 && !NETSTANDARD2_1 && !EFCORE5 && !EFCORE6 throw new NotImplementedException(); #endif -#if NET6_0 +#if EFCORE6 var contextModel = dbContext.GetService().Model; ; #endif -#if NETCOREAPP2_0 || NETCOREAPP3_0 || NETSTANDARD2_0 || NET5_0 || NETSTANDARD2_1 +#if EFCORE2 || EFCORE3 || NETSTANDARD2_0 || EFCORE5 || NETSTANDARD2_1 var contextModel = dbContext.Model as Model; #endif -#if NET6_0 +#if EFCORE6 var contextModelRelationalModel = contextModel.GetRelationalModel() as RelationalModel; contextModelRelationalModel.Tables.Clear(); #endif -#if NET5_0 || NETSTANDARD2_1 +#if EFCORE5 || NETSTANDARD2_1 var contextModelRelationalModel = contextModel.RelationalModel as RelationalModel; contextModelRelationalModel.Tables.Clear(); #endif -#if NETCOREAPP2_0 || NETCOREAPP3_0 || NETSTANDARD2_0 +#if EFCORE2 || EFCORE3 || NETSTANDARD2_0 var entityTypes = contextModel.GetFieldValue("_entityTypes") as SortedDictionary; entityTypes.Clear(); @@ -240,14 +240,14 @@ namespace ShardingCore.Extensions public static void RemoveDbContextRelationModelSaveOnlyThatIsNamedType(this DbContext dbContext, Type shardingType) { -#if !NETCOREAPP2_0 && !NETSTANDARD2_0 && !NETCOREAPP3_0 && !NETSTANDARD2_1 && !NET5_0 && !NET6_0 +#if !EFCORE2 && !NETSTANDARD2_0 && !EFCORE3 && !NETSTANDARD2_1 && !EFCORE5 && !EFCORE6 1 #endif -#if NETCOREAPP2_0 || NETSTANDARD2_0 || NETCOREAPP3_0 ||NET5_0 || NETSTANDARD2_1 +#if EFCORE2 || NETSTANDARD2_0 || EFCORE3 ||EFCORE5 || NETSTANDARD2_1 var contextModel = dbContext.Model as Model; #endif -#if NET6_0 +#if EFCORE6 var contextModel = dbContext.GetService().Model; var entityTypes = contextModel.GetEntityTypes(); foreach (var entityType in entityTypes) @@ -268,7 +268,7 @@ namespace ShardingCore.Extensions } #endif -#if NET5_0 || NETSTANDARD2_1 +#if EFCORE5 || NETSTANDARD2_1 var contextModelRelationalModel = contextModel.RelationalModel as RelationalModel; var entityTypes = contextModel.GetEntityTypes(); @@ -287,7 +287,7 @@ namespace ShardingCore.Extensions contextModelRelationalModel.Tables.Remove(valueTuples[i]); } #endif -#if NETCOREAPP2_0 || NETSTANDARD2_0 || NETCOREAPP3_0 +#if EFCORE2 || NETSTANDARD2_0 || EFCORE3 var entityTypes = contextModel.GetFieldValue("_entityTypes") as SortedDictionary; @@ -318,10 +318,10 @@ namespace ShardingCore.Extensions /// public static void RemoveModelCache(this DbContext dbContext) { -#if !NETCOREAPP2_0 && !NETSTANDARD2_0 && !NETCOREAPP3_0 && !NETSTANDARD2_1 && !NET5_0 && !NET6_0 +#if !EFCORE2 && !NETSTANDARD2_0 && !EFCORE3 && !NETSTANDARD2_1 && !EFCORE5 && !EFCORE6 throw new NotImplementedException(); #endif -#if NET6_0 +#if EFCORE6 var shardingModelSource = dbContext.GetService() as IShardingModelSource; var modelCacheKeyFactory = shardingModelSource.GetModelCacheKeyFactory(); object key1 = modelCacheKeyFactory.Create(dbContext,true); @@ -329,13 +329,13 @@ namespace ShardingCore.Extensions object key2 = modelCacheKeyFactory.Create(dbContext,false); shardingModelSource.Remove(key2); #endif -#if NET5_0 || NETSTANDARD2_1 +#if EFCORE5 || NETSTANDARD2_1 var shardingModelSource = dbContext.GetService() as IShardingModelSource; var modelCacheKeyFactory = shardingModelSource.GetModelCacheKeyFactory(); object key1 = modelCacheKeyFactory.Create(dbContext); shardingModelSource.Remove(key1); #endif -#if NETCOREAPP3_0 || NETSTANDARD2_0 +#if EFCORE3 || NETSTANDARD2_0 var shardingModelSource = dbContext.GetService() as IShardingModelSource; var modelCacheKeyFactory = shardingModelSource.GetModelCacheKeyFactory(); @@ -343,7 +343,7 @@ namespace ShardingCore.Extensions shardingModelSource.Remove(key1); #endif -#if NETCOREAPP2_0 +#if EFCORE2 var shardingModelSource = dbContext.GetService() as IShardingModelSource; var modelCacheKeyFactory = shardingModelSource.GetModelCacheKeyFactory(); diff --git a/src/ShardingCore/Extensions/DbContextExtensions/DbContextExtensionShardingCore7.cs b/src/ShardingCore/Extensions/DbContextExtensions/DbContextExtensionShardingCore7.cs index 2306f6e0..0c75f395 100644 --- a/src/ShardingCore/Extensions/DbContextExtensions/DbContextExtensionShardingCore7.cs +++ b/src/ShardingCore/Extensions/DbContextExtensions/DbContextExtensionShardingCore7.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/src/ShardingCore/Extensions/InternalExtensions/InternalIEntityTypeExtension.cs b/src/ShardingCore/Extensions/InternalExtensions/InternalIEntityTypeExtension.cs index 2fb1a389..c34c6f9a 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 !NETCOREAPP2_0 +#if !EFCORE2 var tableName = entityType.GetTableName(); #endif -#if NETCOREAPP2_0 +#if EFCORE2 var tableName = entityType.Relational().TableName; #endif return tableName; diff --git a/src/ShardingCore/Extensions/LinqExtension.cs b/src/ShardingCore/Extensions/LinqExtension.cs index 390fcd01..9e7e8d69 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 !NET5_0 || NETSTANDARD2_1 +#if !EFCORE5 || NETSTANDARD2_1 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 2b5629a6..a88d721a 100644 --- a/src/ShardingCore/Extensions/ShardingExtension.cs +++ b/src/ShardingCore/Extensions/ShardingExtension.cs @@ -64,10 +64,10 @@ namespace ShardingCore.Extensions { return null; } -#if !NETCOREAPP2_0 +#if !EFCORE2 return expression.Print(); #endif -#if NETCOREAPP2_0 +#if EFCORE2 return expression.ToString(); #endif } diff --git a/src/ShardingCore/Extensions/StreamMergeEnumerableExtension.cs b/src/ShardingCore/Extensions/StreamMergeEnumerableExtension.cs index eb03ccfc..4c815015 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 NETCOREAPP2_0 +#if EFCORE2 var list = await source.ToList(cancellationToken); #endif -#if !NETCOREAPP2_0 +#if !EFCORE2 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 NETCOREAPP2_0 +#if EFCORE2 var asyncEnumerator = source.GetEnumerator(); while (await asyncEnumerator.MoveNext(cancellationToken)) { @@ -56,7 +56,7 @@ namespace ShardingCore.Extensions } } #endif -#if !NETCOREAPP2_0 +#if !EFCORE2 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 4be95dba..746063d7 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 !NETCOREAPP2_0 +#if !EFCORE2 public override int GetHashCode() { return HashCode.Combine(SourceName, TargetName); } #endif -#if NETCOREAPP2_0 +#if EFCORE2 public override int GetHashCode() { diff --git a/src/ShardingCore/Sharding/AbstractShardingDbContext.cs b/src/ShardingCore/Sharding/AbstractShardingDbContext.cs index 61c81386..b9c8718f 100644 --- a/src/ShardingCore/Sharding/AbstractShardingDbContext.cs +++ b/src/ShardingCore/Sharding/AbstractShardingDbContext.cs @@ -81,7 +81,7 @@ namespace ShardingCore.Sharding -#if !NETCOREAPP2_0 +#if !EFCORE2 public override ValueTask> AddAsync(TEntity entity, CancellationToken cancellationToken = new CancellationToken()) { @@ -97,7 +97,7 @@ namespace ShardingCore.Sharding return CreateGenericDbContext(entity).AddAsync(entity, cancellationToken); } #endif -#if NETCOREAPP2_0 +#if EFCORE2 public override Task> AddAsync(TEntity entity, CancellationToken cancellationToken = new CancellationToken()) { if (IsExecutor) @@ -364,10 +364,10 @@ namespace ShardingCore.Sharding using (var tran = await Database.BeginTransactionAsync(cancellationToken)) { i = await ShardingDbContextExecutor.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken); -#if NETCOREAPP2_0 +#if EFCORE2 tran.Commit(); #endif -#if !NETCOREAPP2_0 +#if !EFCORE2 await tran.CommitAsync(cancellationToken); #endif } @@ -394,7 +394,7 @@ namespace ShardingCore.Sharding base.Dispose(); } } -#if !NETCOREAPP2_0 +#if !EFCORE2 public override async ValueTask DisposeAsync() { diff --git a/src/ShardingCore/Sharding/Abstractions/IShardingComplierExecutor.cs b/src/ShardingCore/Sharding/Abstractions/IShardingComplierExecutor.cs index 463c3f2c..173f6365 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 !NETCOREAPP2_0 +#if !EFCORE2 /// /// execute query async /// @@ -31,7 +31,7 @@ namespace ShardingCore.Sharding.Abstractions /// TResult ExecuteAsync(IShardingDbContext shardingDbContext, Expression query, CancellationToken cancellationToken = new CancellationToken()); #endif -#if NETCOREAPP2_0 +#if EFCORE2 /// /// execute query async /// diff --git a/src/ShardingCore/Sharding/Abstractions/IShardingDbContextExecutor.cs b/src/ShardingCore/Sharding/Abstractions/IShardingDbContextExecutor.cs index 9cc38704..4a20745d 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 : IShardingTransaction,IReadWriteSwitch,ICurrentDbContextDiscover,IDisposable -#if !NETCOREAPP2_0 +#if !EFCORE2 , IAsyncDisposable #endif diff --git a/src/ShardingCore/Sharding/Abstractions/IShardingQueryExecutor.cs b/src/ShardingCore/Sharding/Abstractions/IShardingQueryExecutor.cs index d4365837..1a720ac7 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 NETCOREAPP2_0 +#if EFCORE2 using Microsoft.EntityFrameworkCore.Internal; #endif diff --git a/src/ShardingCore/Sharding/Abstractions/IShardingTrackQueryExecutor.cs b/src/ShardingCore/Sharding/Abstractions/IShardingTrackQueryExecutor.cs index 5caf9cd2..74a35491 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 !NETCOREAPP2_0 +#if !EFCORE2 /// /// execute query async /// @@ -30,7 +30,7 @@ namespace ShardingCore.Sharding.Abstractions #endif -#if NETCOREAPP2_0 +#if EFCORE2 /// /// execute query async /// diff --git a/src/ShardingCore/Sharding/Abstractions/IShardingTransaction.cs b/src/ShardingCore/Sharding/Abstractions/IShardingTransaction.cs index 247131e5..0e33c7c5 100644 --- a/src/ShardingCore/Sharding/Abstractions/IShardingTransaction.cs +++ b/src/ShardingCore/Sharding/Abstractions/IShardingTransaction.cs @@ -18,10 +18,10 @@ namespace ShardingCore.Sharding.Abstractions void NotifyShardingTransaction(); void Rollback(); void Commit(); -#if !NETCOREAPP2_0 +#if !EFCORE2 Task RollbackAsync(CancellationToken cancellationToken = new CancellationToken()); Task CommitAsync(CancellationToken cancellationToken = new CancellationToken()); -#if !NETCOREAPP3_0 && !NETSTANDARD2_0 +#if !EFCORE3 && !NETSTANDARD2_0 void CreateSavepoint(string name); Task CreateSavepointAsync(string name, CancellationToken cancellationToken = new CancellationToken()); void RollbackToSavepoint(string name); diff --git a/src/ShardingCore/Sharding/Abstractions/ISupportShardingTransaction.cs b/src/ShardingCore/Sharding/Abstractions/ISupportShardingTransaction.cs index fc0ade64..d6933002 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 !NETCOREAPP2_0 +//#if !EFCORE2 // 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 8da4751d..4f1da019 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 NETCOREAPP2_0 +#if EFCORE2 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 9b4f156e..c5af6119 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.NETCOREAPP2_0x +namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync.EFCORE2x { /* * @Author: xjm @@ -14,13 +14,13 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync.NETCOREAPP2_0x * @Ver: 1.0 * @Email: 326308290@qq.com */ -#if NETCOREAPP2_0 - internal class NETCOREAPP2_0TryCurrentAsyncEnumerator:IAsyncEnumerator +#if EFCORE2 + internal class EFCORE2TryCurrentAsyncEnumerator:IAsyncEnumerator { private readonly IAsyncEnumerator _asyncEnumerator; private bool currentMoved=false; - public NETCOREAPP2_0TryCurrentAsyncEnumerator(IAsyncEnumerator asyncEnumerator) + public EFCORE2TryCurrentAsyncEnumerator(IAsyncEnumerator asyncEnumerator) { _asyncEnumerator = asyncEnumerator; } diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryGroupByOrderStreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryGroupByOrderStreamMergeAsyncEnumerator.cs index 0e3f1a03..493af5f2 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 !NETCOREAPP2_0 +#if !EFCORE2 while (await streamMergeAsyncEnumerator.MoveNextAsync()) #endif -#if NETCOREAPP2_0 +#if EFCORE2 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 !NETCOREAPP2_0 +#if !EFCORE2 while ( streamMergeAsyncEnumerator.MoveNext()) #endif -#if NETCOREAPP2_0 +#if EFCORE2 while (streamMergeAsyncEnumerator.MoveNext()) #endif { @@ -76,7 +76,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync { return _inMemoryReallyCount; } -#if !NETCOREAPP2_0 +#if !EFCORE2 public ValueTask DisposeAsync() { @@ -134,7 +134,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync { return _inMemoryEnumerator.Current; } -#if NETCOREAPP2_0 +#if EFCORE2 public void Dispose() { _inMemoryEnumerator?.Dispose(); diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryReverseStreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/InMemoryReverseStreamMergeAsyncEnumerator.cs index a4a66618..6d10a290 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 !NETCOREAPP2_0 +#if !EFCORE2 public async ValueTask DisposeAsync() { @@ -56,7 +56,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync return _reverseEnumerator.MoveNext(); } #endif -#if NETCOREAPP2_0 +#if EFCORE2 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 7c2fd6c7..8aa7120e 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 !NETCOREAPP2_0 +#if !EFCORE2 while (await streamMergeAsyncEnumerator.MoveNextAsync()) #endif -#if NETCOREAPP2_0 +#if EFCORE2 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 !NETCOREAPP2_0 +#if !EFCORE2 while ( streamMergeAsyncEnumerator.MoveNext()) #endif -#if NETCOREAPP2_0 +#if EFCORE2 while (streamMergeAsyncEnumerator.MoveNext()) #endif { @@ -75,7 +75,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync { return _inMemoryReallyCount; } -#if !NETCOREAPP2_0 +#if !EFCORE2 public ValueTask DisposeAsync() { @@ -133,7 +133,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync { return _inMemoryEnumerator.Current; } -#if NETCOREAPP2_0 +#if EFCORE2 public void Dispose() { _inMemoryEnumerator?.Dispose(); diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/MultiAggregateOrderStreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/MultiAggregateOrderStreamMergeAsyncEnumerator.cs index f0939ab6..02d05e9e 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 !NETCOREAPP2_0 +#if !EFCORE2 public async ValueTask MoveNextAsync() #endif -#if NETCOREAPP2_0 +#if EFCORE2 public async Task MoveNext(CancellationToken cancellationToken = new CancellationToken()) #endif { if (_queue.IsEmpty()) return false; -#if !NETCOREAPP2_0 +#if !EFCORE2 var hasNext = await SetCurrentValueAsync(); #endif -#if NETCOREAPP2_0 +#if EFCORE2 var hasNext = await SetCurrentValueAsync(cancellationToken); #endif if (hasNext) @@ -91,10 +91,10 @@ namespace ShardingCore.Sharding.Enumerators return true; } -#if !NETCOREAPP2_0 +#if !EFCORE2 private async ValueTask SetCurrentValueAsync() #endif -#if NETCOREAPP2_0 +#if EFCORE2 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 !NETCOREAPP2_0 +#if !EFCORE2 if (await first.MoveNextAsync()) #endif -#if NETCOREAPP2_0 +#if EFCORE2 if (await first.MoveNext(cancellationToken)) #endif { @@ -240,7 +240,7 @@ namespace ShardingCore.Sharding.Enumerators return CurrentValue; } -#if !NETCOREAPP2_0 +#if !EFCORE2 public async ValueTask DisposeAsync() { diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/MultiOrderStreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/MultiOrderStreamMergeAsyncEnumerator.cs index 9dfb2ab5..336598d5 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 !NETCOREAPP2_0 +#if !EFCORE2 public async ValueTask MoveNextAsync() #endif -#if NETCOREAPP2_0 +#if EFCORE2 public async Task MoveNext(CancellationToken cancellationToken = new CancellationToken()) #endif { @@ -61,11 +61,11 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync } var first = _queue.Poll(); -#if !NETCOREAPP2_0 +#if !EFCORE2 if (await first.MoveNextAsync()) #endif -#if NETCOREAPP2_0 +#if EFCORE2 if (await first.MoveNext(cancellationToken)) #endif @@ -128,7 +128,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync return _currentEnumerator.GetCurrent(); } -#if !NETCOREAPP2_0 +#if !EFCORE2 public async ValueTask DisposeAsync() { diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/OneAtMostElementStreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/OneAtMostElementStreamMergeAsyncEnumerator.cs index ce2dd0bf..180ccec6 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 !NETCOREAPP2_0 && !NETSTANDARD2_0 && !NETCOREAPP3_0 && !NET5_0 && !NETSTANDARD2_1 +#if !EFCORE2 && !NETSTANDARD2_0 && !EFCORE3 && !EFCORE5 && !NETSTANDARD2_1 public ValueTask DisposeAsync() { return ValueTask.CompletedTask; @@ -46,7 +46,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync } #endif -#if NETCOREAPP3_0 || NETSTANDARD2_0 || NET5_0 || NETSTANDARD2_1 +#if EFCORE3 || NETSTANDARD2_0 || EFCORE5 || NETSTANDARD2_1 public ValueTask DisposeAsync() { return new ValueTask(); @@ -100,7 +100,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync { return _constantElement; } -#if NETCOREAPP2_0 +#if EFCORE2 public void Dispose() { } diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/OrderStreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/OrderStreamMergeAsyncEnumerator.cs index 3b9d5747..cf1f9d55 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 !NETCOREAPP2_0 +#if !EFCORE2 public async ValueTask MoveNextAsync() #endif -#if NETCOREAPP2_0 +#if EFCORE2 public async Task MoveNext(CancellationToken cancellationToken = new CancellationToken()) #endif { -#if !NETCOREAPP2_0 +#if !EFCORE2 var has = await _enumerator.MoveNextAsync(); #endif -#if NETCOREAPP2_0 +#if EFCORE2 var has = await _enumerator.MoveNext(cancellationToken); #endif SetOrderValues(); @@ -134,7 +134,7 @@ namespace ShardingCore.Sharding.Enumerators { return _orderValues ?? new List(0); } -#if !NETCOREAPP2_0 +#if !EFCORE2 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 d8e74c98..1ae09ecf 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 !NETCOREAPP2_0 +#if !EFCORE2 public async ValueTask MoveNextAsync() #endif -#if NETCOREAPP2_0 +#if EFCORE2 public async Task MoveNext(CancellationToken cancellationToken = new CancellationToken()) #endif { //如果合并数据的时候不需要跳过也没有take多少那么就是直接next while (_skip.GetValueOrDefault() > this.realSkip) { -#if !NETCOREAPP2_0 +#if !EFCORE2 var has = await _enumerator.MoveNextAsync(); #endif -#if NETCOREAPP2_0 +#if EFCORE2 var has = await _enumerator.MoveNext(cancellationToken); #endif @@ -56,10 +56,10 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync return false; } -#if !NETCOREAPP2_0 +#if !EFCORE2 var next = await _enumerator.MoveNextAsync(); #endif -#if NETCOREAPP2_0 +#if EFCORE2 var next = await _enumerator.MoveNext(cancellationToken); #endif @@ -129,7 +129,7 @@ namespace ShardingCore.Sharding.Enumerators.StreamMergeAsync { _enumerator.Dispose(); } -#if !NETCOREAPP2_0 +#if !EFCORE2 public ValueTask DisposeAsync() { diff --git a/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/StreamMergeAsyncEnumerator.cs b/src/ShardingCore/Sharding/Enumerators/StreamMergeAsync/StreamMergeAsyncEnumerator.cs index 55e5c47a..2aa4c2e3 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 !NETCOREAPP2_0 +#if !EFCORE2 public async ValueTask DisposeAsync() { if (_asyncEnumerator) @@ -111,7 +111,7 @@ namespace ShardingCore.Sharding.Enumerators if (_syncEnumerator) return _syncSource.Current; return default; } -#if NETCOREAPP2_0 +#if EFCORE2 public void Dispose() { _asyncSource?.Dispose(); diff --git a/src/ShardingCore/Sharding/Enumerators/TrackerEnumerables/AsyncTrackerEnumerable.cs b/src/ShardingCore/Sharding/Enumerators/TrackerEnumerables/AsyncTrackerEnumerable.cs index 500aedc0..b8356126 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 !NETCOREAPP2_0 +#if !EFCORE2 public IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = new CancellationToken()) { return new AsyncTrackerEnumerator(_shardingDbContext,_asyncEnumerable.GetAsyncEnumerator(cancellationToken)); } #endif -#if NETCOREAPP2_0 +#if EFCORE2 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 10d60f85..77f7ca81 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 !NETCOREAPP2_0 +#if !EFCORE2 internal class AsyncTrackerEnumerator : IAsyncEnumerator { @@ -60,7 +60,7 @@ namespace ShardingCore.Sharding.Enumerators.TrackerEnumerators } #endif -#if NETCOREAPP2_0 +#if EFCORE2 public class AsyncTrackerEnumerator : IAsyncEnumerator { diff --git a/src/ShardingCore/Sharding/MergeContexts/QueryableRewriteEngine.cs b/src/ShardingCore/Sharding/MergeContexts/QueryableRewriteEngine.cs index cc8da98c..464f1988 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 NETCOREAPP2_0 +#if EFCORE2 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 143590e7..b82dc1e1 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 !NETCOREAPP2_0 +#if !EFCORE2 public ValueTask DisposeAsync() { return new ValueTask(); @@ -20,7 +20,7 @@ namespace ShardingCore.Sharding.MergeEngines.Enumerables } #endif -#if NETCOREAPP2_0 +#if EFCORE2 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 b0922660..49f7ac1e 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 !NETCOREAPP2_0 +#if !EFCORE2 public IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = new CancellationToken()) { cancellationToken.ThrowIfCancellationRequested(); @@ -46,7 +46,7 @@ namespace ShardingCore.Sharding.MergeEngines.EnumeratorStreamMergeEngines } #endif -#if NETCOREAPP2_0 +#if EFCORE2 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 2be270a2..aa04b118 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.NETCOREAPP2_0x; +using ShardingCore.Sharding.Enumerators.StreamMergeAsync.EFCORE2x; 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 NETCOREAPP2_0 +#if EFCORE2 using Microsoft.EntityFrameworkCore.Extensions.Internal; #endif @@ -65,14 +65,14 @@ namespace ShardingCore.Sharding.MergeEngines.Executors.Enumerables.Abstractions /// public async Task> GetAsyncEnumerator0(IQueryable newQueryable) { -#if !NETCOREAPP2_0 +#if !EFCORE2 var enumator = newQueryable.AsAsyncEnumerable().GetAsyncEnumerator(); await enumator.MoveNextAsync(); return enumator; #endif -#if NETCOREAPP2_0 +#if EFCORE2 var enumator = - new NETCOREAPP2_0TryCurrentAsyncEnumerator(newQueryable.AsAsyncEnumerable().GetEnumerator()); + new EFCORE2TryCurrentAsyncEnumerator(newQueryable.AsAsyncEnumerable().GetEnumerator()); await enumator.MoveNext(); return enumator; #endif diff --git a/src/ShardingCore/Sharding/MergeEngines/Executors/Methods/ExecuteDeleteMethodExecutor.cs b/src/ShardingCore/Sharding/MergeEngines/Executors/Methods/ExecuteDeleteMethodExecutor.cs index 0ce98fe7..a79bab53 100644 --- a/src/ShardingCore/Sharding/MergeEngines/Executors/Methods/ExecuteDeleteMethodExecutor.cs +++ b/src/ShardingCore/Sharding/MergeEngines/Executors/Methods/ExecuteDeleteMethodExecutor.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using System; using System.Linq; using System.Linq.Expressions; diff --git a/src/ShardingCore/Sharding/MergeEngines/Executors/Methods/ExecuteUpdateMethodExecutor.cs b/src/ShardingCore/Sharding/MergeEngines/Executors/Methods/ExecuteUpdateMethodExecutor.cs index 90848698..96764b75 100644 --- a/src/ShardingCore/Sharding/MergeEngines/Executors/Methods/ExecuteUpdateMethodExecutor.cs +++ b/src/ShardingCore/Sharding/MergeEngines/Executors/Methods/ExecuteUpdateMethodExecutor.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using System; using System.Linq; using System.Linq.Expressions; diff --git a/src/ShardingCore/Sharding/MergeEngines/Executors/Methods/SumMethodExecutor.cs b/src/ShardingCore/Sharding/MergeEngines/Executors/Methods/SumMethodExecutor.cs index 71a7cbe2..7c98b342 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 !NETCOREAPP2_0 +#if !EFCORE2 return ShardingEntityFrameworkQueryableExtensions.ExecuteAsync>( ShardingQueryableMethods.GetSumWithoutSelector(resultType), (IQueryable)queryable, (Expression)null, cancellationToken); #endif -#if NETCOREAPP2_0 +#if EFCORE2 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 44565e92..e66446b6 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 NETCOREAPP2_0 +#if EFCORE2 using Microsoft.EntityFrameworkCore.Extensions.Internal; #endif @@ -27,7 +27,7 @@ namespace ShardingCore.Sharding.MergeEngines.ShardingMergeEngines.Abstractions.S } -#if !NETCOREAPP2_0 +#if !EFCORE2 public IAsyncEnumerator GetAsyncEnumerator( CancellationToken cancellationToken = new CancellationToken()) { @@ -35,7 +35,7 @@ namespace ShardingCore.Sharding.MergeEngines.ShardingMergeEngines.Abstractions.S } #endif -#if NETCOREAPP2_0 +#if EFCORE2 IAsyncEnumerator IAsyncEnumerable.GetEnumerator() { return GetStreamMergeAsyncEnumerator(true); diff --git a/src/ShardingCore/Sharding/MergeEngines/ShardingMergeEngines/ExecuteDeleteAsyncMemoryMergeEngine.cs b/src/ShardingCore/Sharding/MergeEngines/ShardingMergeEngines/ExecuteDeleteAsyncMemoryMergeEngine.cs index 87698ce0..a5c5322a 100644 --- a/src/ShardingCore/Sharding/MergeEngines/ShardingMergeEngines/ExecuteDeleteAsyncMemoryMergeEngine.cs +++ b/src/ShardingCore/Sharding/MergeEngines/ShardingMergeEngines/ExecuteDeleteAsyncMemoryMergeEngine.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using ShardingCore.Sharding.MergeEngines.Executors.Abstractions; using ShardingCore.Sharding.MergeEngines.Executors.Methods; using ShardingCore.Sharding.MergeEngines.ShardingMergeEngines.Abstractions.InMemoryMerge; diff --git a/src/ShardingCore/Sharding/MergeEngines/ShardingMergeEngines/ExecuteUpdateAsyncMemoryMergeEngine.cs b/src/ShardingCore/Sharding/MergeEngines/ShardingMergeEngines/ExecuteUpdateAsyncMemoryMergeEngine.cs index d284a22d..a5bfa241 100644 --- a/src/ShardingCore/Sharding/MergeEngines/ShardingMergeEngines/ExecuteUpdateAsyncMemoryMergeEngine.cs +++ b/src/ShardingCore/Sharding/MergeEngines/ShardingMergeEngines/ExecuteUpdateAsyncMemoryMergeEngine.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using ShardingCore.Sharding.MergeEngines.Executors.Abstractions; using ShardingCore.Sharding.MergeEngines.Executors.Methods; using ShardingCore.Sharding.MergeEngines.ShardingMergeEngines.Abstractions.InMemoryMerge; diff --git a/src/ShardingCore/Sharding/Parsers/Visitors/ShardingQueryPrepareVisitor2_6.cs b/src/ShardingCore/Sharding/Parsers/Visitors/ShardingQueryPrepareVisitor2_6.cs index 9c14de31..4f14c9ba 100644 --- a/src/ShardingCore/Sharding/Parsers/Visitors/ShardingQueryPrepareVisitor2_6.cs +++ b/src/ShardingCore/Sharding/Parsers/Visitors/ShardingQueryPrepareVisitor2_6.cs @@ -55,7 +55,7 @@ namespace ShardingCore.Sharding.Parsers.Visitors shardingQueryableAsSequenceOptions, shardingEntities, isNoTracking, isIgnoreFilter); } -#if NETCOREAPP2_0 || NETSTANDARD2_0 || NETCOREAPP3_0 +#if EFCORE2 || NETSTANDARD2_0 || EFCORE3 protected override Expression VisitConstant(ConstantExpression node) { if (node.Value is IQueryable queryable) @@ -66,7 +66,7 @@ namespace ShardingCore.Sharding.Parsers.Visitors return base.VisitConstant(node); } #endif -#if NET5_0 || NETSTANDARD2_1 || NET6_0 +#if EFCORE5 || NETSTANDARD2_1 || EFCORE6 protected override Expression VisitExtension(Expression node) { if (node is QueryRootExpression queryRootExpression) diff --git a/src/ShardingCore/Sharding/Parsers/Visitors/ShardingQueryPrepareVisitor7.cs b/src/ShardingCore/Sharding/Parsers/Visitors/ShardingQueryPrepareVisitor7.cs index 5e3c9e65..31f40545 100644 --- a/src/ShardingCore/Sharding/Parsers/Visitors/ShardingQueryPrepareVisitor7.cs +++ b/src/ShardingCore/Sharding/Parsers/Visitors/ShardingQueryPrepareVisitor7.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using System; using System.Collections; using System.Collections.Generic; diff --git a/src/ShardingCore/Sharding/ShardingDbContextExecutors/DataSourceDbContext.cs b/src/ShardingCore/Sharding/ShardingDbContextExecutors/DataSourceDbContext.cs index 750ddc1c..a56a52d2 100644 --- a/src/ShardingCore/Sharding/ShardingDbContextExecutors/DataSourceDbContext.cs +++ b/src/ShardingCore/Sharding/ShardingDbContextExecutors/DataSourceDbContext.cs @@ -350,7 +350,7 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors return; CurrentDbContextTransaction?.Commit(); } -#if !NETCOREAPP2_0 +#if !EFCORE2 public async Task RollbackAsync(CancellationToken cancellationToken = new CancellationToken()) { cancellationToken.ThrowIfCancellationRequested(); @@ -369,7 +369,7 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors if (CurrentDbContextTransaction != null) await CurrentDbContextTransaction.CommitAsync(cancellationToken); } -#if !NETCOREAPP3_0&&!NETSTANDARD2_0 +#if !EFCORE3&&!NETSTANDARD2_0 public void CreateSavepoint(string name) { if (IsDefault) @@ -429,7 +429,7 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors dataSourceDbContext.Value.Dispose(); } } -#if !NETCOREAPP2_0 +#if !EFCORE2 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 a9b0e6f9..d854bf7a 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 !NETCOREAPP2_0 +#if !EFCORE2 , IAsyncDisposable #endif { @@ -46,10 +46,10 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors void Rollback(); void Commit(); -#if !NETCOREAPP2_0 +#if !EFCORE2 Task RollbackAsync(CancellationToken cancellationToken = new CancellationToken()); Task CommitAsync(CancellationToken cancellationToken = new CancellationToken()); -#if !NETCOREAPP3_0&&!NETSTANDARD2_0 +#if !EFCORE3&&!NETSTANDARD2_0 void CreateSavepoint(string name); Task CreateSavepointAsync(string name, CancellationToken cancellationToken = new CancellationToken()); void RollbackToSavepoint(string name); diff --git a/src/ShardingCore/Sharding/ShardingDbContextExecutors/ShardingDbContextExecutor.cs b/src/ShardingCore/Sharding/ShardingDbContextExecutors/ShardingDbContextExecutor.cs index d6a0488a..cf8a1963 100644 --- a/src/ShardingCore/Sharding/ShardingDbContextExecutors/ShardingDbContextExecutor.cs +++ b/src/ShardingCore/Sharding/ShardingDbContextExecutors/ShardingDbContextExecutor.cs @@ -245,7 +245,7 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors dbContextCache.Value.Dispose(); } } -#if !NETCOREAPP2_0 +#if !EFCORE2 public async Task RollbackAsync(CancellationToken cancellationToken = new CancellationToken()) { @@ -279,7 +279,7 @@ namespace ShardingCore.Sharding.ShardingDbContextExecutors AutoUseWriteConnectionString(); } -#if !NETCOREAPP3_0 && !NETSTANDARD2_0 +#if !EFCORE3 && !NETSTANDARD2_0 public void CreateSavepoint(string name) { diff --git a/src/ShardingCore/Sharding/ShardingEntityFrameworkQueryableExtensions.cs b/src/ShardingCore/Sharding/ShardingEntityFrameworkQueryableExtensions.cs index 20ec4f8a..af90af9c 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 NETCOREAPP3_0 || NETSTANDARD2_0 +#if EFCORE3 || NETSTANDARD2_0 using Microsoft.EntityFrameworkCore.Query.Internal; #endif @@ -20,7 +20,7 @@ namespace ShardingCore.Sharding { internal class ShardingEntityFrameworkQueryableExtensions { -#if !NETCOREAPP2_0 +#if !EFCORE2 public static TResult ExecuteAsync( MethodInfo operatorMethodInfo, IQueryable source, @@ -90,7 +90,7 @@ namespace ShardingCore.Sharding #endif -#if NETCOREAPP2_0 +#if EFCORE2 public static Task ExecuteAsync( diff --git a/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingCompilerExecutor.cs b/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingCompilerExecutor.cs index e75cc7f4..4d8b9dd0 100644 --- a/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingCompilerExecutor.cs +++ b/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingCompilerExecutor.cs @@ -48,7 +48,7 @@ namespace ShardingCore.Sharding.ShardingExecutors } -#if !NETCOREAPP2_0 +#if !EFCORE2 public TResult ExecuteAsync(IShardingDbContext shardingDbContext, Expression query, CancellationToken cancellationToken = new CancellationToken()) @@ -65,7 +65,7 @@ namespace ShardingCore.Sharding.ShardingExecutors } #endif -#if NETCOREAPP2_0 +#if EFCORE2 public IAsyncEnumerable ExecuteAsync(IShardingDbContext shardingDbContext, Expression query) { //预解析表达式 diff --git a/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingQueryExecutor.cs b/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingQueryExecutor.cs index b4fe19d7..8fa869d4 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 NETCOREAPP2_0 +#if EFCORE2 using Microsoft.EntityFrameworkCore.Internal; #endif @@ -121,7 +121,7 @@ namespace ShardingCore.Sharding.ShardingQueryExecutors return EnsureResultTypeMergeExecute(typeof(ContainsAsyncInMemoryMergeEngine<>), mergeQueryCompilerContext, async, cancellationToken); -#if SHARDINGCORE7 +#if EFCORE7 case nameof(RelationalQueryableExtensions.ExecuteUpdate): return EnsureResultTypeMergeExecute(typeof(ExecuteUpdateAsyncMemoryMergeEngine<>), mergeQueryCompilerContext, async, cancellationToken); diff --git a/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingTrackQueryExecutor.cs b/src/ShardingCore/Sharding/ShardingExecutors/DefaultShardingTrackQueryExecutor.cs index 7b50d32e..c957151f 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 !NETCOREAPP2_0 +#if !EFCORE2 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 NETCOREAPP2_0 +#if EFCORE2 public IAsyncEnumerable ExecuteAsync(IQueryCompilerContext queryCompilerContext) { diff --git a/src/ShardingCore/Sharding/ShardingExecutors/QueryCompilerContextFactory.cs b/src/ShardingCore/Sharding/ShardingExecutors/QueryCompilerContextFactory.cs index 550557b3..d1398aa6 100644 --- a/src/ShardingCore/Sharding/ShardingExecutors/QueryCompilerContextFactory.cs +++ b/src/ShardingCore/Sharding/ShardingExecutors/QueryCompilerContextFactory.cs @@ -119,7 +119,7 @@ namespace ShardingCore.Sharding.ShardingExecutors case nameof(Queryable.LongCount): case nameof(Queryable.Any): return _whereQueryableCombine; -#if SHARDINGCORE7 +#if EFCORE7 case nameof(RelationalQueryableExtensions.ExecuteUpdate): return _executeUpdateQueryableCombine; case nameof(RelationalQueryableExtensions.ExecuteDelete): diff --git a/src/ShardingCore/Sharding/StreamMergeContext.cs b/src/ShardingCore/Sharding/StreamMergeContext.cs index 7af48075..30a783df 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 !NETCOREAPP2_0 +#if !EFCORE2 , IAsyncDisposable #endif { @@ -362,7 +362,7 @@ namespace ShardingCore.Sharding dbContext.Dispose(); } } -#if !NETCOREAPP2_0 +#if !EFCORE2 public async ValueTask DisposeAsync() { @@ -402,7 +402,7 @@ namespace ShardingCore.Sharding ReSetOrders(propertyOrders); } } -#if !NETCOREAPP2_0 +#if !EFCORE2 public async ValueTask DbContextDisposeAsync(DbContext dbContext) { @@ -416,7 +416,7 @@ namespace ShardingCore.Sharding return false; } #endif -#if NETCOREAPP2_0 +#if EFCORE2 public Task DbContextDisposeAsync(DbContext dbContext) { diff --git a/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor2_6.cs b/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor2_6.cs index 9b13a3c2..01cc2e55 100644 --- a/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor2_6.cs +++ b/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor2_6.cs @@ -134,7 +134,7 @@ namespace ShardingCore.Core.Internal.Visitors } } -#if NETCOREAPP2_0 || NETCOREAPP3_0 || NETSTANDARD2_0 +#if EFCORE2 || EFCORE3 || NETSTANDARD2_0 internal class DbContextReplaceQueryableVisitor : DbContextInnerMemberReferenceReplaceQueryableVisitor { private readonly DbContext _dbContext; @@ -174,7 +174,7 @@ namespace ShardingCore.Core.Internal.Visitors } #endif -#if NET5_0 || NETSTANDARD2_1 || NET6_0 +#if EFCORE5 || NETSTANDARD2_1 || EFCORE6 internal class DbContextReplaceQueryableVisitor : DbContextInnerMemberReferenceReplaceQueryableVisitor { private readonly DbContext _dbContext; diff --git a/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor7.cs b/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor7.cs index 11f45ab5..99225c99 100644 --- a/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor7.cs +++ b/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor7.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using System; using System.Linq; using System.Linq.Expressions; diff --git a/src/ShardingCore/Sharding/Visitors/Querys/QueryEntitiesVisitor2_6.cs b/src/ShardingCore/Sharding/Visitors/Querys/QueryEntitiesVisitor2_6.cs index a528797e..dc455c37 100644 --- a/src/ShardingCore/Sharding/Visitors/Querys/QueryEntitiesVisitor2_6.cs +++ b/src/ShardingCore/Sharding/Visitors/Querys/QueryEntitiesVisitor2_6.cs @@ -18,7 +18,7 @@ namespace ShardingCore.Core.Internal.Visitors.Querys * @Date: Saturday, 20 February 2021 11:14:35 * @Email: 326308290@qq.com */ -#if NETCOREAPP2_0 || NETCOREAPP3_0 || NETSTANDARD2_0 +#if EFCORE2 || EFCORE3 || NETSTANDARD2_0 /// /// 获取分表类型 /// @@ -115,7 +115,7 @@ namespace ShardingCore.Core.Internal.Visitors.Querys } #endif -#if NET5_0 || NETSTANDARD2_1 || NET6_0 +#if EFCORE5 || NETSTANDARD2_1 || EFCORE6 /// /// 获取分表类型 /// diff --git a/src/ShardingCore/Sharding/Visitors/Querys/QueryEntitiesVisitor7.cs b/src/ShardingCore/Sharding/Visitors/Querys/QueryEntitiesVisitor7.cs index 63175962..c27c351c 100644 --- a/src/ShardingCore/Sharding/Visitors/Querys/QueryEntitiesVisitor7.cs +++ b/src/ShardingCore/Sharding/Visitors/Querys/QueryEntitiesVisitor7.cs @@ -1,4 +1,4 @@ -#if SHARDINGCORE7 +#if EFCORE7 using System; using System.Collections; using System.Collections.Generic; diff --git a/src/ShardingCore/ShardingCore.csproj b/src/ShardingCore/ShardingCore.csproj index efc758ab..0ca38e00 100644 --- a/src/ShardingCore/ShardingCore.csproj +++ b/src/ShardingCore/ShardingCore.csproj @@ -1,9 +1,9 @@  net6;net7; - 7.0.0.5 + $(EFCORE7) true - TRACE;DEBUG;SHARDINGCORE7; + TRACE;DEBUG;EFCORE7; latest https://github.com/dotnetcore/sharding-core logo.png @@ -34,7 +34,6 @@ - diff --git a/src2/ShardingCore2/ShardingCore2.csproj b/src2/ShardingCore2/ShardingCore2.csproj new file mode 100644 index 00000000..a6f6c48b --- /dev/null +++ b/src2/ShardingCore2/ShardingCore2.csproj @@ -0,0 +1,34 @@ + + + + netstandard2.0 + $(EFCORE2) + true + TRACE;DEBUG;EFCORE2; + 9.0 + ShardingCore + ShardingCore + https://github.com/xuejmnet/sharding-core + + + + true + bin\Release\ShardingCore2.xml + + + + True + \ + + + + + + + + + + + + + diff --git a/src3/ShardingCore3/ShardingCore3.csproj b/src3/ShardingCore3/ShardingCore3.csproj new file mode 100644 index 00000000..3c666c8b --- /dev/null +++ b/src3/ShardingCore3/ShardingCore3.csproj @@ -0,0 +1,35 @@ + + + netstandard2.0 + $(EFCORE3) + true + TRACE;DEBUG;EFCORE3; + 9.0 + ShardingCore + ShardingCore + https://github.com/xuejmnet/sharding-core + + + + true + bin\Release\ShardingCore3.xml + + + + True + \ + + + + + + + + + + + + + + + diff --git a/src5/ShardingCore5/ShardingCore5.csproj b/src5/ShardingCore5/ShardingCore5.csproj new file mode 100644 index 00000000..2a7d844f --- /dev/null +++ b/src5/ShardingCore5/ShardingCore5.csproj @@ -0,0 +1,38 @@ + + + + netstandard2.1 + $(EFCORE5) + true + TRACE;DEBUG;EFCORE5; + 9.0 + ShardingCore + ShardingCore + https://github.com/xuejmnet/sharding-core + + + + true + bin\Release\ShardingCore5.xml + + + + True + \ + + + + + + + + + + + + + + + + + diff --git a/src6/ShardingCore6/ShardingCore6.csproj b/src6/ShardingCore6/ShardingCore6.csproj new file mode 100644 index 00000000..dfd01bd8 --- /dev/null +++ b/src6/ShardingCore6/ShardingCore6.csproj @@ -0,0 +1,37 @@ + + + + net6.0 + $(EFCORE6) + true + TRACE;DEBUG;EFCORE6; + 9.0 + ShardingCore + ShardingCore + https://github.com/xuejmnet/sharding-core + + + + true + bin\Release\ShardingCore6.xml + + + + True + \ + + + + + + + + + + + + + + + + diff --git a/test/ShardingCore.Test/Startup.cs b/test/ShardingCore.Test/Startup.cs index d8586f51..4f6ece91 100644 --- a/test/ShardingCore.Test/Startup.cs +++ b/test/ShardingCore.Test/Startup.cs @@ -105,7 +105,6 @@ namespace ShardingCore.Test }; }, ReadStrategyEnum.Loop, defaultEnable: false, readConnStringGetStrategy: ReadConnStringGetStrategyEnum.LatestEveryTime); }) - .ReplaceService() .AddShardingCore(); }