Skip to content

Commit c2f14e3

Browse files
committed
添加对.netstandard2.0和.netstandard2.1的支持
1 parent 16046d3 commit c2f14e3

24 files changed

+142
-142
lines changed

README-zh.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ Release | EF Core | .NET | .NET (Core)
4444

4545
Release | .NET (Core)
4646
--- | ---
47-
[6.x.x.x](https://www.nuget.org/packages/ShardingCore) | 6.0
48-
[5.x.x.x](https://www.nuget.org/packages/ShardingCore) | 5.0
49-
[3.x.x.x](https://www.nuget.org/packages/ShardingCore) | netcoreapp3
47+
[6.x.x.x](https://www.nuget.org/packages/ShardingCore) | net6
48+
[5.x.x.x](https://www.nuget.org/packages/ShardingCore) | net5 or netstandard2.1
49+
[3.x.x.x](https://www.nuget.org/packages/ShardingCore) | netcoreapp3 or netstandard2.0
5050
[2.x.x.x](https://www.nuget.org/packages/ShardingCore) | netcoreapp2
5151

5252

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ Use Condition Compile With NetFramework not
4343

4444
Release | .NET (Core)
4545
--- | ---
46-
[6.x.x.x](https://www.nuget.org/packages/ShardingCore) | 6.0
47-
[5.x.x.x](https://www.nuget.org/packages/ShardingCore) | 5.0
48-
[3.x.x.x](https://www.nuget.org/packages/ShardingCore) | netcoreapp3
46+
[6.x.x.x](https://www.nuget.org/packages/ShardingCore) | net6
47+
[5.x.x.x](https://www.nuget.org/packages/ShardingCore) | net5 or netstandard2.1
48+
[3.x.x.x](https://www.nuget.org/packages/ShardingCore) | netcoreapp3 or netstandard2.0
4949
[2.x.x.x](https://www.nuget.org/packages/ShardingCore) | netcoreapp2
5050

5151
## Quick start

src/ShardingCore/EFCores/ChangeTrackers/ShardingChangeTracker.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public ShardingChangeTracker(DbContext context, IStateManager stateManager, ICha
2020
_dbContext = context;
2121
}
2222

23-
#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0
23+
#if !NETCOREAPP2_0 && !NETSTANDARD2_0 && !NETCOREAPP3_0 && !NETSTANDARD2_1 && !NET5_0 && !NET6_0
2424
error
2525
#endif
2626

@@ -122,7 +122,7 @@ public override void CascadeChanges()
122122
}
123123

124124
#endif
125-
#if !NETCOREAPP2_0 && !NETCOREAPP3_0
125+
#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NETSTANDARD2_0
126126
public override void Clear()
127127
{
128128
if (_dbContext is IShardingDbContext)

src/ShardingCore/EFCores/EFCore3x/ScriptMigrationGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if NETCOREAPP3_0
1+
#if NETCOREAPP3_0 || NETSTANDARD2_0 || NETSTANDARD2_0
22
using Microsoft.EntityFrameworkCore.Migrations;
33
using ShardingCore.Core.RuntimeContexts;
44

src/ShardingCore/EFCores/EFCore3x/ShardingModelSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if NETCOREAPP3_0
1+
#if NETCOREAPP3_0 || NETSTANDARD2_0
22
using System;
33
using System.Collections.Generic;
44
using System.Linq;

src/ShardingCore/EFCores/EFCore5x/ScriptMigrationGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if NET5_0
1+
#if NET5_0 || NETSTANDARD2_1
22
using Microsoft.EntityFrameworkCore.Migrations;
33
using ShardingCore.Core.RuntimeContexts;
44

src/ShardingCore/EFCores/EFCore5x/ShardingModelSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if NET5_0
1+
#if NET5_0 || NETSTANDARD2_1
22
using System;
33
using System.Collections.Generic;
44
using System.Diagnostics.CodeAnalysis;

src/ShardingCore/EFCores/OptionsExtensions/ShardingOptionsExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace ShardingCore.EFCores.OptionsExtensions
1414
* @Ver: 1.0
1515
* @Email: 326308290@qq.com
1616
*/
17-
#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0
17+
#if !NETCOREAPP2_0 && !NETSTANDARD2_0 && !NETCOREAPP3_0 && !NETSTANDARD2_1 && !NET5_0 && !NET6_0
1818
error
1919
#endif
2020

@@ -63,7 +63,7 @@ public override void PopulateDebugInfo(IDictionary<string, string> debugInfo)
6363
}
6464
}
6565
#endif
66-
#if NETCOREAPP3_0 || NET5_0
66+
#if NETCOREAPP3_0 || NETSTANDARD2_0 || NET5_0 || NETSTANDARD2_1
6767
public class ShardingOptionsExtension: IDbContextOptionsExtension
6868
{
6969
public IShardingRuntimeContext ShardingRuntimeContext { get; }

src/ShardingCore/EFCores/OptionsExtensions/ShardingWrapOptionsExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace ShardingCore.EFCores.OptionsExtensions
1515
* @Email: 326308290@qq.com
1616
*/
1717

18-
#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0
18+
#if !NETCOREAPP2_0 && !NETSTANDARD2_0 && !NETCOREAPP3_0 && !NETSTANDARD2_1 && !NET5_0 && !NET6_0
1919
error
2020
#endif
2121
#if NET6_0
@@ -55,7 +55,7 @@ public override void PopulateDebugInfo(IDictionary<string, string> debugInfo)
5555
}
5656
}
5757
#endif
58-
#if NETCOREAPP3_0 || NET5_0
58+
#if NETCOREAPP3_0 || NETSTANDARD2_0 || NET5_0 || NETSTANDARD2_1
5959

6060
public class ShardingWrapOptionsExtension: IDbContextOptionsExtension
6161
{

src/ShardingCore/EFCores/OptionsExtensions/UnionAllMergeOptionsExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace ShardingCore.EFCores.OptionsExtensions
1414
* @Email: 326308290@qq.com
1515
*/
1616

17-
#if !NETCOREAPP2_0 && !NETCOREAPP3_0 && !NET5_0 && !NET6_0
17+
#if !NETCOREAPP2_0 && !NETSTANDARD2_0 && !NETCOREAPP3_0 && !NETSTANDARD2_1 && !NET5_0 && !NET6_0
1818
error
1919
#endif
2020
#if NET6_0
@@ -50,7 +50,7 @@ public override void PopulateDebugInfo(IDictionary<string, string> debugInfo)
5050
}
5151
}
5252
#endif
53-
#if NETCOREAPP3_0 || NET5_0
53+
#if NETCOREAPP3_0 || NETSTANDARD2_0 || NET5_0 || NETSTANDARD2_1
5454

5555
public class UnionAllMergeOptionsExtension: IDbContextOptionsExtension
5656
{

0 commit comments

Comments
 (0)