Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 7444a49

Browse files
committed
Rename to use NETCORE build symbol
1 parent 1fdfb0a commit 7444a49

10 files changed

Lines changed: 29 additions & 26 deletions

File tree

src/Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<AssemblyVersion>5.0.0.0</AssemblyVersion>
66
<Authors>ServiceStack</Authors>
77
<Company>ServiceStack, Inc.</Company>
8-
<Copyright>&#169; 2008-2018 ServiceStack, Inc</Copyright>
8+
<Copyright>&#169; 2008-2022 ServiceStack, Inc</Copyright>
99
<PackageOutputPath>$(MSBuildProjectDirectory)/../../NuGet/</PackageOutputPath>
1010
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1111
<PackageProjectUrl>https://github.com/ServiceStack/ServiceStack.OrmLite</PackageProjectUrl>
@@ -45,11 +45,11 @@
4545
</PropertyGroup>
4646

4747
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
48-
<DefineConstants>$(DefineConstants);NET6_0</DefineConstants>
48+
<DefineConstants>$(DefineConstants);NET6_0;NET6_0_OR_GREATER</DefineConstants>
4949
</PropertyGroup>
5050

51-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'netcoreapp3.1' OR '$(TargetFramework)' == 'net6.0' ">
52-
<DefineConstants>$(DefineConstants);NETCORE_SUPPORT;NETCORE</DefineConstants>
51+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'netcoreapp3.1' OR '$(TargetFramework)' == 'net5.0' OR '$(TargetFramework)' == 'net6.0' ">
52+
<DefineConstants>$(DefineConstants);NETCORE;NETCORE_SUPPORT</DefineConstants>
5353
</PropertyGroup>
5454

5555
<ItemGroup>

src/ServiceStack.OrmLite.SqlServer/SqlServerOrmLiteDialectProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
using ServiceStack.DataAnnotations;
1414
using ServiceStack.OrmLite.SqlServer.Converters;
1515
using ServiceStack.Text;
16-
#if NETSTANDARD2_0 || NET6_0
16+
#if NETCORE
1717
using ApplicationException = System.InvalidOperationException;
1818
#endif
1919

src/ServiceStack.OrmLite.Sqlite/Converters/SqliteDateTimeConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public override object FromDbValue(Type fieldType, object value)
117117

118118
if (DateStyle == DateTimeKind.Utc)
119119
{
120-
#if NETSTANDARD2_0 || NET6_0
120+
#if NETCORE
121121
//.NET Core returns correct Local time but as Unspecified so change to Local and Convert to UTC
122122
dateTime = DateTime.SpecifyKind(dateTime, DateTimeKind.Local).ToUniversalTime();
123123
#else

src/ServiceStack.OrmLite.Sqlite/SqliteOrmLiteDialectProviderBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected SqliteOrmLiteDialectProviderBase()
2828
base.RegisterConverter<Guid>(new SqliteGuidConverter());
2929
base.RegisterConverter<bool>(new SqliteBoolConverter());
3030
base.RegisterConverter<byte[]>(new SqliteByteArrayConverter());
31-
#if NETSTANDARD2_0 || NET6_0
31+
#if NETCORE
3232
base.RegisterConverter<char>(new SqliteCharConverter());
3333
#endif
3434
this.Variables = new Dictionary<string, string>
@@ -114,7 +114,7 @@ public override IDbConnection CreateConnection(string connectionString, Dictiona
114114
Directory.CreateDirectory(existingDir);
115115
}
116116
}
117-
#if NETSTANDARD2_0 || NET6_0
117+
#if NETCORE
118118
connString.AppendFormat(@"Data Source={0};", connectionString.Trim());
119119
#else
120120
connString.AppendFormat(@"Data Source={0};Version=3;New=True;Compress=True;", connectionString.Trim());

src/ServiceStack.OrmLite/Converters/SpecialConverters.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.Reflection;
77
using System.Runtime.Serialization;
88
using ServiceStack.DataAnnotations;
9-
#if NETSTANDARD2_0 || NET6_0
9+
#if NETCORE
1010
using System.Globalization;
1111
#endif
1212

src/ServiceStack.OrmLite/OrmLiteConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public static void ResetLogFactory(ILogFactory logFactory=null)
156156

157157
public static bool DisableColumnGuessFallback { get; set; }
158158
public static bool StripUpperInLike { get; set; }
159-
#if NETSTANDARD2_0 || NET6_0
159+
#if NETCORE
160160
= true;
161161
#endif
162162

src/ServiceStack.OrmLite/OrmLiteContext.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Collections.Concurrent;
44
using System.Collections.Generic;
55
using System.Data;
6-
#if !NETSTANDARD2_0 && !NET6_0
6+
#if !NETCORE
77
using System.Runtime.Remoting.Messaging;
88
#endif
99
using System.Threading;
@@ -23,8 +23,8 @@ public class OrmLiteContext
2323
[ThreadStatic]
2424
public static IDictionary ContextItems;
2525

26-
#if NETSTANDARD2_0 || NET6_0
27-
AsyncLocal<IDictionary> localContextItems = new AsyncLocal<IDictionary>();
26+
#if NETCORE
27+
AsyncLocal<IDictionary> localContextItems = new();
2828
#endif
2929

3030
/// <summary>
@@ -40,7 +40,7 @@ public virtual IDictionary Items
4040

4141
private IDictionary GetItems()
4242
{
43-
#if NETSTANDARD2_0 || NET6_0
43+
#if NETCORE
4444
if (UseThreadStatic)
4545
return ContextItems;
4646

@@ -63,7 +63,7 @@ private IDictionary GetItems()
6363

6464
private IDictionary CreateItems(IDictionary items = null)
6565
{
66-
#if NETSTANDARD2_0 || NET6_0
66+
#if NETCORE
6767
if (UseThreadStatic)
6868
{
6969
ContextItems = items ??= new Dictionary<object, object>();
@@ -101,7 +101,7 @@ public void ClearItems()
101101
}
102102
else
103103
{
104-
#if NETSTANDARD2_0 || NET6_0
104+
#if NETCORE
105105
localContextItems.Value = new ConcurrentDictionary<object, object>();
106106
#else
107107
CallContext.FreeNamedDataSlot(_key);

src/ServiceStack.OrmLite/ServiceStack.OrmLite.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
<PackageTags>OrmLite;RDBMS;SQL;POCO;Code-First;ORM;Schema-less;Blobs</PackageTags>
1414
<DefineConstants>$(DefineConstants);ASYNC</DefineConstants>
1515
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
17+
<DefineConstants>$(DefineConstants);NETCORE;NETSTANDARD2_0</DefineConstants>
18+
</PropertyGroup>
19+
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
20+
<DefineConstants>$(DefineConstants);NETCORE;NET6_0</DefineConstants>
21+
</PropertyGroup>
1622

1723
<ItemGroup>
1824
<PackageReference Include="System.Memory" Version="4.5.4" />

src/ServiceStack.OrmLite/SqlBuilder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void AddDynamicParams(object cmdParams)
6969
public object CreateDynamicType()
7070
{
7171
var assemblyName = new AssemblyName { Name = "tmpAssembly" };
72-
#if NETSTANDARD2_0 || NET6_0
72+
#if NETCORE
7373
var typeBuilder =
7474
AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run)
7575
.DefineDynamicModule("tmpModule")
@@ -144,7 +144,7 @@ public object CreateDynamicType()
144144

145145
ctorIL.Emit(OpCodes.Ret);
146146

147-
#if NETSTANDARD2_0 || NET6_0
147+
#if NETCORE
148148
var generetedType = typeBuilder.CreateTypeInfo().AsType();
149149
#else
150150
var generetedType = typeBuilder.CreateType();

tests/Directory.Build.props

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
<PropertyGroup>
44
<Version>5.12.1</Version>
5-
<AssemblyVersion>5.0.0.0</AssemblyVersion>
65
<LangVersion>latest</LangVersion>
7-
<Authors>ServiceStack</Authors>
8-
<Company>ServiceStack, Inc.</Company>
9-
<Copyright>&#169; 2008-2018 ServiceStack, Inc</Copyright>
6+
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
107
</PropertyGroup>
118

129
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
@@ -30,19 +27,19 @@
3027
</PropertyGroup>
3128

3229
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
33-
<DefineConstants>$(DefineConstants);NETSTANDARD;NETSTANDARD2_0</DefineConstants>
30+
<DefineConstants>$(DefineConstants);NETCORE;NETSTANDARD2_0</DefineConstants>
3431
</PropertyGroup>
3532

3633
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.1' ">
3734
<DefineConstants>$(DefineConstants);NETSTANDARD;NETSTANDARD2_1</DefineConstants>
3835
</PropertyGroup>
3936

4037
<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
41-
<DefineConstants>$(DefineConstants);NET6_0</DefineConstants>
38+
<DefineConstants>$(DefineConstants);NET6_0;NET6_0_OR_GREATER</DefineConstants>
4239
</PropertyGroup>
4340

44-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'netcoreapp3.1' OR '$(TargetFramework)' == 'net6.0' ">
45-
<DefineConstants>$(DefineConstants);NETCORE_SUPPORT;NETCORE</DefineConstants>
41+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'netcoreapp3.1' OR '$(TargetFramework)' == 'net5.0' OR '$(TargetFramework)' == 'net6.0' ">
42+
<DefineConstants>$(DefineConstants);NETCORE;NETCORE_SUPPORT</DefineConstants>
4643
</PropertyGroup>
4744

4845
</Project>

0 commit comments

Comments
 (0)