Skip to content

Commit 70aef54

Browse files
committed
v0.3.0
1 parent fe6c7d5 commit 70aef54

10 files changed

Lines changed: 150 additions & 142 deletions

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<!-- Project properties -->
33
<PropertyGroup>
4-
<LangVersion>12</LangVersion>
4+
<LangVersion>13</LangVersion>
55
</PropertyGroup>
66

77
<!-- NuGet -->

src/NuExt.System.Data.csproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,25 @@ System.Data.DataTableExtensions
1616
System.Data.DalBase
1717
System.Data.DbConverter&lt;TDbConnection&gt;
1818
System.Data.IDbContext</Description>
19-
<Version>0.2.4</Version>
19+
<Version>0.3.0</Version>
2020
<RootNamespace />
2121
<GenerateDocumentationFile>True</GenerateDocumentationFile>
2222
<NoWarn>$(NoWarn);1591</NoWarn>
2323
<PackageReadmeFile>README.md</PackageReadmeFile>
2424
<PackageIcon>logo128.png</PackageIcon>
2525
<PackageProjectUrl>https://github.com/IvanGit/NuExt.System.Data</PackageProjectUrl>
2626
</PropertyGroup>
27+
28+
<PropertyGroup Condition="'$(TargetFramework)' == 'net9.0' or '$(TargetFramework)' == 'net8.0' or '$(TargetFramework)' == 'net6.0'">
29+
<DefineConstants>$(DefineConstants);NET</DefineConstants>
30+
</PropertyGroup>
31+
32+
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net462'">
33+
<DefineConstants>$(DefineConstants);NET_OLD</DefineConstants>
34+
</PropertyGroup>
2735

2836
<ItemGroup Condition="'$(UseNuExtPackages)' == 'true'">
29-
<PackageReference Include="NuExt.System" Version="0.2.3" />
37+
<PackageReference Include="NuExt.System" Version="0.3.0" />
3038
</ItemGroup>
3139

3240
<ItemGroup Condition="'$(UseNuExtPackages)' == 'false'">

src/System/Data/DalBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected bool TryCreateDbContext([NotNull] ref TDbContext? context)
6161
/// </exception>
6262
protected virtual ValueTask TryExecuteInDbContextAsync(TDbContext? context, Action<TDbContext> action, CancellationToken cancellationToken = default)
6363
{
64-
#if NET6_0_OR_GREATER
64+
#if NET
6565
ArgumentNullException.ThrowIfNull(action);
6666
#else
6767
Throw.IfNull(action);
@@ -105,7 +105,7 @@ protected virtual ValueTask TryExecuteInDbContextAsync(TDbContext? context, Acti
105105
/// </exception>
106106
protected virtual async ValueTask TryExecuteInDbContextAsync(TDbContext? context, Func<TDbContext, ValueTask> action, CancellationToken cancellationToken = default)
107107
{
108-
#if NET6_0_OR_GREATER
108+
#if NET
109109
ArgumentNullException.ThrowIfNull(action);
110110
#else
111111
Throw.IfNull(action);
@@ -149,7 +149,7 @@ protected virtual async ValueTask TryExecuteInDbContextAsync(TDbContext? context
149149
/// </exception>
150150
protected virtual ValueTask<T> TryExecuteInDbContextAsync<T>(TDbContext? context, Func<TDbContext, T> func, CancellationToken cancellationToken = default)
151151
{
152-
#if NET6_0_OR_GREATER
152+
#if NET
153153
ArgumentNullException.ThrowIfNull(func);
154154
#else
155155
Throw.IfNull(func);
@@ -194,7 +194,7 @@ protected virtual ValueTask<T> TryExecuteInDbContextAsync<T>(TDbContext? context
194194
/// </exception>
195195
protected virtual async ValueTask<T> TryExecuteInDbContextAsync<T>(TDbContext? context, Func<TDbContext, ValueTask<T>> func, CancellationToken cancellationToken = default)
196196
{
197-
#if NET6_0_OR_GREATER
197+
#if NET
198198
ArgumentNullException.ThrowIfNull(func);
199199
#else
200200
Throw.IfNull(func);

src/System/Data/DataReaderExtensions.FwStd20.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if NETFRAMEWORK || NETSTANDARD2_0
1+
#if NET_OLD
22
using System.ComponentModel;
33
using System.Data.Common;
44

src/System/Data/DataReaderExtensions.Nullable.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ partial class DataReaderExtensions
66
{
77
public static bool? GetNullableBoolean(this DbDataReader reader, int ordinal)
88
{
9-
#if NET6_0_OR_GREATER
9+
#if NET
1010
ArgumentNullException.ThrowIfNull(reader);
1111
#else
1212
Throw.IfNull(reader);
@@ -20,7 +20,7 @@ partial class DataReaderExtensions
2020

2121
public static bool? GetNullableBoolean(this DbDataReader reader, string name)
2222
{
23-
#if NET6_0_OR_GREATER
23+
#if NET
2424
ArgumentNullException.ThrowIfNull(reader);
2525
#else
2626
Throw.IfNull(reader);
@@ -35,7 +35,7 @@ partial class DataReaderExtensions
3535

3636
public static byte? GetNullableByte(this DbDataReader reader, int ordinal)
3737
{
38-
#if NET6_0_OR_GREATER
38+
#if NET
3939
ArgumentNullException.ThrowIfNull(reader);
4040
#else
4141
Throw.IfNull(reader);
@@ -49,7 +49,7 @@ partial class DataReaderExtensions
4949

5050
public static byte? GetNullableByte(this DbDataReader reader, string name)
5151
{
52-
#if NET6_0_OR_GREATER
52+
#if NET
5353
ArgumentNullException.ThrowIfNull(reader);
5454
#else
5555
Throw.IfNull(reader);
@@ -64,7 +64,7 @@ partial class DataReaderExtensions
6464

6565
public static char? GetNullableChar(this DbDataReader reader, int ordinal)
6666
{
67-
#if NET6_0_OR_GREATER
67+
#if NET
6868
ArgumentNullException.ThrowIfNull(reader);
6969
#else
7070
Throw.IfNull(reader);
@@ -78,7 +78,7 @@ partial class DataReaderExtensions
7878

7979
public static char? GetNullableChar(this DbDataReader reader, string name)
8080
{
81-
#if NET6_0_OR_GREATER
81+
#if NET
8282
ArgumentNullException.ThrowIfNull(reader);
8383
#else
8484
Throw.IfNull(reader);
@@ -93,7 +93,7 @@ partial class DataReaderExtensions
9393

9494
public static DateTime? GetNullableDateTime(this DbDataReader reader, int ordinal)
9595
{
96-
#if NET6_0_OR_GREATER
96+
#if NET
9797
ArgumentNullException.ThrowIfNull(reader);
9898
#else
9999
Throw.IfNull(reader);
@@ -107,7 +107,7 @@ partial class DataReaderExtensions
107107

108108
public static DateTime? GetNullableDateTime(this DbDataReader reader, string name)
109109
{
110-
#if NET6_0_OR_GREATER
110+
#if NET
111111
ArgumentNullException.ThrowIfNull(reader);
112112
#else
113113
Throw.IfNull(reader);
@@ -122,7 +122,7 @@ partial class DataReaderExtensions
122122

123123
public static decimal? GetNullableDecimal(this DbDataReader reader, int ordinal)
124124
{
125-
#if NET6_0_OR_GREATER
125+
#if NET
126126
ArgumentNullException.ThrowIfNull(reader);
127127
#else
128128
Throw.IfNull(reader);
@@ -136,7 +136,7 @@ partial class DataReaderExtensions
136136

137137
public static decimal? GetNullableDecimal(this DbDataReader reader, string name)
138138
{
139-
#if NET6_0_OR_GREATER
139+
#if NET
140140
ArgumentNullException.ThrowIfNull(reader);
141141
#else
142142
Throw.IfNull(reader);
@@ -151,7 +151,7 @@ partial class DataReaderExtensions
151151

152152
public static double? GetNullableDouble(this DbDataReader reader, int ordinal)
153153
{
154-
#if NET6_0_OR_GREATER
154+
#if NET
155155
ArgumentNullException.ThrowIfNull(reader);
156156
#else
157157
Throw.IfNull(reader);
@@ -165,7 +165,7 @@ partial class DataReaderExtensions
165165

166166
public static double? GetNullableDouble(this DbDataReader reader, string name)
167167
{
168-
#if NET6_0_OR_GREATER
168+
#if NET
169169
ArgumentNullException.ThrowIfNull(reader);
170170
#else
171171
Throw.IfNull(reader);
@@ -180,7 +180,7 @@ partial class DataReaderExtensions
180180

181181
public static float? GetNullableFloat(this DbDataReader reader, int ordinal)
182182
{
183-
#if NET6_0_OR_GREATER
183+
#if NET
184184
ArgumentNullException.ThrowIfNull(reader);
185185
#else
186186
Throw.IfNull(reader);
@@ -194,7 +194,7 @@ partial class DataReaderExtensions
194194

195195
public static float? GetNullableFloat(this DbDataReader reader, string name)
196196
{
197-
#if NET6_0_OR_GREATER
197+
#if NET
198198
ArgumentNullException.ThrowIfNull(reader);
199199
#else
200200
Throw.IfNull(reader);
@@ -209,7 +209,7 @@ partial class DataReaderExtensions
209209

210210
public static Guid? GetNullableGuid(this DbDataReader reader, int ordinal)
211211
{
212-
#if NET6_0_OR_GREATER
212+
#if NET
213213
ArgumentNullException.ThrowIfNull(reader);
214214
#else
215215
Throw.IfNull(reader);
@@ -223,7 +223,7 @@ partial class DataReaderExtensions
223223

224224
public static Guid? GetNullableGuid(this DbDataReader reader, string name)
225225
{
226-
#if NET6_0_OR_GREATER
226+
#if NET
227227
ArgumentNullException.ThrowIfNull(reader);
228228
#else
229229
Throw.IfNull(reader);
@@ -238,7 +238,7 @@ partial class DataReaderExtensions
238238

239239
public static short? GetNullableInt16(this DbDataReader reader, int ordinal)
240240
{
241-
#if NET6_0_OR_GREATER
241+
#if NET
242242
ArgumentNullException.ThrowIfNull(reader);
243243
#else
244244
Throw.IfNull(reader);
@@ -252,7 +252,7 @@ partial class DataReaderExtensions
252252

253253
public static short? GetNullableInt16(this DbDataReader reader, string name)
254254
{
255-
#if NET6_0_OR_GREATER
255+
#if NET
256256
ArgumentNullException.ThrowIfNull(reader);
257257
#else
258258
Throw.IfNull(reader);
@@ -267,7 +267,7 @@ partial class DataReaderExtensions
267267

268268
public static int? GetNullableInt32(this DbDataReader reader, int ordinal)
269269
{
270-
#if NET6_0_OR_GREATER
270+
#if NET
271271
ArgumentNullException.ThrowIfNull(reader);
272272
#else
273273
Throw.IfNull(reader);
@@ -281,7 +281,7 @@ partial class DataReaderExtensions
281281

282282
public static int? GetNullableInt32(this DbDataReader reader, string name)
283283
{
284-
#if NET6_0_OR_GREATER
284+
#if NET
285285
ArgumentNullException.ThrowIfNull(reader);
286286
#else
287287
Throw.IfNull(reader);
@@ -296,7 +296,7 @@ partial class DataReaderExtensions
296296

297297
public static long? GetNullableInt64(this DbDataReader reader, int ordinal)
298298
{
299-
#if NET6_0_OR_GREATER
299+
#if NET
300300
ArgumentNullException.ThrowIfNull(reader);
301301
#else
302302
Throw.IfNull(reader);
@@ -310,7 +310,7 @@ partial class DataReaderExtensions
310310

311311
public static long? GetNullableInt64(this DbDataReader reader, string name)
312312
{
313-
#if NET6_0_OR_GREATER
313+
#if NET
314314
ArgumentNullException.ThrowIfNull(reader);
315315
#else
316316
Throw.IfNull(reader);
@@ -325,7 +325,7 @@ partial class DataReaderExtensions
325325

326326
public static string? GetNullableString(this DbDataReader reader, int ordinal)
327327
{
328-
#if NET6_0_OR_GREATER
328+
#if NET
329329
ArgumentNullException.ThrowIfNull(reader);
330330
#else
331331
Throw.IfNull(reader);
@@ -339,7 +339,7 @@ partial class DataReaderExtensions
339339

340340
public static string? GetNullableString(this DbDataReader reader, string name)
341341
{
342-
#if NET6_0_OR_GREATER
342+
#if NET
343343
ArgumentNullException.ThrowIfNull(reader);
344344
#else
345345
Throw.IfNull(reader);

0 commit comments

Comments
 (0)