Skip to content

Commit 40db073

Browse files
committed
v0.3.0
1 parent 90141c0 commit 40db073

10 files changed

+71
-31
lines changed

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 -->

Directory.Build.targets

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project>
2+
3+
<ItemGroup>
4+
<Compile Update="**\*.Adapters.cs">
5+
<DependentUpon>$([System.String]::Copy('%(Filename)').Replace('.Adapters', '.cs'))</DependentUpon>
6+
</Compile>
7+
<Compile Update="**\*.Asserts.cs">
8+
<DependentUpon>$([System.String]::Copy('%(Filename)').Replace('.Asserts', '.cs'))</DependentUpon>
9+
</Compile>
10+
<Compile Update="**\*.AsyncLock.cs">
11+
<DependentUpon>$([System.String]::Copy('%(Filename)').Replace('.AsyncLock', '.cs'))</DependentUpon>
12+
</Compile>
13+
<Compile Update="**\*.Commands.cs">
14+
<DependentUpon>$([System.String]::Copy('%(Filename)').Replace('.Commands', '.cs'))</DependentUpon>
15+
</Compile>
16+
<Compile Update="**\*.IDbConnection.cs">
17+
<DependentUpon>$([System.String]::Copy('%(Filename)').Replace('.IDbConnection', '.cs'))</DependentUpon>
18+
</Compile>
19+
<Compile Update="**\*.Transactions.cs">
20+
<DependentUpon>$([System.String]::Copy('%(Filename)').Replace('.Transactions', '.cs'))</DependentUpon>
21+
</Compile>
22+
</ItemGroup>
23+
24+
</Project>

src/GlobalSuppressions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// This file is used by Code Analysis to maintain SuppressMessage
2+
// attributes that are applied to this project.
3+
// Project-level suppressions either have no target or are given
4+
// a specific target and scoped to a namespace, type, member, etc.
5+
6+
using System.Diagnostics.CodeAnalysis;
7+
8+
[assembly: SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression", Justification = "<Pending>", Scope = "namespaceanddescendants", Target = "~N:System.Data.SQLite")]

src/NuExt.System.Data.SQLite.csproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ System.Data.SQLite.SQLiteDbConnection
1414
System.Data.SQLite.SQLiteDbContext
1515
System.Data.SQLite.SQLiteDbConverter
1616
System.Data.SQLite.SQLiteDbTransaction</Description>
17-
<Version>0.2.4</Version>
17+
<Version>0.3.0</Version>
1818
<RootNamespace />
1919
<GenerateDocumentationFile>True</GenerateDocumentationFile>
2020
<NoWarn>$(NoWarn);1591</NoWarn>
@@ -23,12 +23,20 @@ System.Data.SQLite.SQLiteDbTransaction</Description>
2323
<PackageProjectUrl>https://github.com/IvanGit/NuExt.System.Data.SQLite</PackageProjectUrl>
2424
</PropertyGroup>
2525

26+
<PropertyGroup Condition="'$(TargetFramework)' == 'net9.0' or '$(TargetFramework)' == 'net8.0' or '$(TargetFramework)' == 'net6.0'">
27+
<DefineConstants>$(DefineConstants);NET</DefineConstants>
28+
</PropertyGroup>
29+
30+
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net462'">
31+
<DefineConstants>$(DefineConstants);NET_OLD</DefineConstants>
32+
</PropertyGroup>
33+
2634
<ItemGroup>
2735
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.119" />
2836
</ItemGroup>
2937

3038
<ItemGroup Condition="'$(UseNuExtPackages)' == 'true'">
31-
<PackageReference Include="NuExt.System.Data" Version="0.2.4" />
39+
<PackageReference Include="NuExt.System.Data" Version="0.3.0" />
3240
</ItemGroup>
3341

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

src/System/Data/SQLite/SQLiteDalBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected sealed override SQLiteDbContext CreateDbContext()
5151
/// </exception>
5252
protected override ValueTask TryExecuteInDbContextAsync(SQLiteDbContext? context, Action<SQLiteDbContext> action, CancellationToken cancellationToken = default)
5353
{
54-
#if NET6_0_OR_GREATER
54+
#if NET
5555
ArgumentNullException.ThrowIfNull(action);
5656
#else
5757
Throw.IfNull(action);
@@ -95,7 +95,7 @@ protected override ValueTask TryExecuteInDbContextAsync(SQLiteDbContext? context
9595
/// </exception>
9696
protected override async ValueTask TryExecuteInDbContextAsync(SQLiteDbContext? context, Func<SQLiteDbContext, ValueTask> action, CancellationToken cancellationToken = default)
9797
{
98-
#if NET6_0_OR_GREATER
98+
#if NET
9999
ArgumentNullException.ThrowIfNull(action);
100100
#else
101101
Throw.IfNull(action);
@@ -140,7 +140,7 @@ await connection.AcquireLockAsync(async () =>
140140
/// </exception>
141141
protected override ValueTask<T> TryExecuteInDbContextAsync<T>(SQLiteDbContext? context, Func<SQLiteDbContext, T> func, CancellationToken cancellationToken = default)
142142
{
143-
#if NET6_0_OR_GREATER
143+
#if NET
144144
ArgumentNullException.ThrowIfNull(func);
145145
#else
146146
Throw.IfNull(func);
@@ -187,7 +187,7 @@ protected override ValueTask<T> TryExecuteInDbContextAsync<T>(SQLiteDbContext? c
187187
/// </exception>
188188
protected override async ValueTask<T> TryExecuteInDbContextAsync<T>(SQLiteDbContext? context, Func<SQLiteDbContext, ValueTask<T>> func, CancellationToken cancellationToken = default)
189189
{
190-
#if NET6_0_OR_GREATER
190+
#if NET
191191
ArgumentNullException.ThrowIfNull(func);
192192
#else
193193
Throw.IfNull(func);

src/System/Data/SQLite/SQLiteDbConnectionExtensions.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public static void ExecuteInTransaction(this SQLiteDbConnection connection, Acti
88
{
99
Debug.Assert(connection is not null, $"{nameof(connection)} is null");
1010
Debug.Assert(action is not null, $"{nameof(action)} is null");
11-
#if NET6_0_OR_GREATER
11+
#if NET
1212
ArgumentNullException.ThrowIfNull(connection);
1313
ArgumentNullException.ThrowIfNull(action);
1414
#else
@@ -49,7 +49,7 @@ public static T ExecuteInTransaction<T>(this SQLiteDbConnection connection, Func
4949
{
5050
Debug.Assert(connection is not null, $"{nameof(connection)} is null");
5151
Debug.Assert(action is not null, $"{nameof(action)} is null");
52-
#if NET6_0_OR_GREATER
52+
#if NET
5353
ArgumentNullException.ThrowIfNull(connection);
5454
ArgumentNullException.ThrowIfNull(action);
5555
#else
@@ -90,7 +90,7 @@ public static ICollection<string> GetTableColumns(this SQLiteDbConnection connec
9090
{
9191
Debug.Assert(connection is not null, $"{nameof(connection)} is null");
9292
Debug.Assert(!string.IsNullOrEmpty(tableName), $"{nameof(tableName)} is null or empty");
93-
#if NET6_0_OR_GREATER
93+
#if NET
9494
ArgumentNullException.ThrowIfNull(connection);
9595
#else
9696
Throw.IfNull(connection);
@@ -117,7 +117,7 @@ public static DataTable GetTableSchema(this SQLiteDbConnection connection, strin
117117
{
118118
Debug.Assert(connection is not null, $"{nameof(connection)} is null");
119119
Debug.Assert(!string.IsNullOrEmpty(tableName), $"{nameof(tableName)} is null or empty");
120-
#if NET6_0_OR_GREATER
120+
#if NET
121121
ArgumentNullException.ThrowIfNull(connection);
122122
#else
123123
Throw.IfNull(connection);
@@ -135,7 +135,7 @@ public static DataTable GetTableSchema(this SQLiteDbConnection connection, strin
135135
public static ICollection<string> GetAllTables(this SQLiteDbConnection connection, CancellationToken cancellationToken = default)
136136
{
137137
Debug.Assert(connection is not null, $"{nameof(connection)} is null");
138-
#if NET6_0_OR_GREATER
138+
#if NET
139139
ArgumentNullException.ThrowIfNull(connection);
140140
#else
141141
Throw.IfNull(connection);
@@ -156,7 +156,7 @@ void Read(SQLiteDataReader reader)
156156
public static ICollection<string> GetAllViews(this SQLiteDbConnection connection, CancellationToken cancellationToken = default)
157157
{
158158
Debug.Assert(connection is not null, $"{nameof(connection)} is null");
159-
#if NET6_0_OR_GREATER
159+
#if NET
160160
ArgumentNullException.ThrowIfNull(connection);
161161
#else
162162
Throw.IfNull(connection);
@@ -178,7 +178,7 @@ public static ICollection<string> GetTableIndexes(this SQLiteDbConnection connec
178178
{
179179
Debug.Assert(connection is not null, $"{nameof(connection)} is null");
180180
Debug.Assert(!string.IsNullOrEmpty(tableName), $"{nameof(tableName)} is null or empty");
181-
#if NET6_0_OR_GREATER
181+
#if NET
182182
ArgumentNullException.ThrowIfNull(connection);
183183
#else
184184
Throw.IfNull(connection);
@@ -204,7 +204,7 @@ public static bool IsTableEmpty(this SQLiteDbConnection connection, string table
204204
{
205205
Debug.Assert(connection is not null, $"{nameof(connection)} is null");
206206
Debug.Assert(!string.IsNullOrEmpty(tableName), $"{nameof(tableName)} is null or empty");
207-
#if NET6_0_OR_GREATER
207+
#if NET
208208
ArgumentNullException.ThrowIfNull(connection);
209209
#else
210210
Throw.IfNull(connection);
@@ -222,7 +222,7 @@ public static bool IsTableExist(this SQLiteDbConnection connection, string table
222222
{
223223
Debug.Assert(connection is not null, $"{nameof(connection)} is null");
224224
Debug.Assert(!string.IsNullOrEmpty(tableName), $"{nameof(tableName)} is null or empty");
225-
#if NET6_0_OR_GREATER
225+
#if NET
226226
ArgumentNullException.ThrowIfNull(connection);
227227
#else
228228
Throw.IfNull(connection);
@@ -242,7 +242,7 @@ public static bool IsTableIndexExist(this SQLiteDbConnection connection, string
242242
Debug.Assert(connection is not null, $"{nameof(connection)} is null");
243243
Debug.Assert(!string.IsNullOrEmpty(tableName), $"{nameof(tableName)} is null or empty");
244244
Debug.Assert(!string.IsNullOrEmpty(indexName), $"{nameof(indexName)} is null or empty");
245-
#if NET6_0_OR_GREATER
245+
#if NET
246246
ArgumentNullException.ThrowIfNull(connection);
247247
#else
248248
Throw.IfNull(connection);
@@ -266,7 +266,7 @@ public static bool IsTriggerExist(this SQLiteDbConnection connection, string tri
266266
{
267267
Debug.Assert(connection is not null, $"{nameof(connection)} is null");
268268
Debug.Assert(!string.IsNullOrEmpty(triggerName), $"{nameof(triggerName)} is null or empty");
269-
#if NET6_0_OR_GREATER
269+
#if NET
270270
ArgumentNullException.ThrowIfNull(connection);
271271
#else
272272
Throw.IfNull(connection);
@@ -285,7 +285,7 @@ public static bool IsViewExist(this SQLiteDbConnection connection, string viewNa
285285
{
286286
Debug.Assert(connection is not null, $"{nameof(connection)} is null");
287287
Debug.Assert(!string.IsNullOrEmpty(viewName), $"{nameof(viewName)} is null or empty");
288-
#if NET6_0_OR_GREATER
288+
#if NET
289289
ArgumentNullException.ThrowIfNull(connection);
290290
#else
291291
Throw.IfNull(connection);

src/System/Data/SQLite/SQLiteDbTransaction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void ApplyToCommand(SQLiteCommand command)
6262
{
6363
CheckDisposed();
6464
Debug.Assert(command != null, $"{nameof(command)} is null");
65-
#if NET6_0_OR_GREATER
65+
#if NET
6666
ArgumentNullException.ThrowIfNull(command);
6767
#else
6868
Throw.IfNull(command);

src/System/Data/SQLite/SQLiteParameterExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static class SQLiteParameterExtensions
1515
public static SQLiteParameter CreateInputParam(this DbType dbType, string parameterName, object? objValue = null)
1616
{
1717
Debug.Assert(!string.IsNullOrEmpty(parameterName), $"{nameof(parameterName)} is null or empty");
18-
#if NETFRAMEWORK || NETSTANDARD2_0
18+
#if NET_OLD
1919
Debug.Assert(parameterName?.StartsWith("@") == true, $"Parameter name '{parameterName}' should starts with '@'");
2020
#else
2121
Debug.Assert(parameterName?.StartsWith('@') == true, $"Parameter name '{parameterName}' should starts with '@'");
@@ -25,7 +25,7 @@ public static SQLiteParameter CreateInputParam(this DbType dbType, string parame
2525
#else
2626
Throw.IfNullOrEmpty(parameterName);
2727
#endif
28-
#if NETFRAMEWORK || NETSTANDARD2_0
28+
#if NET_OLD
2929
Throw.ArgumentExceptionIf(parameterName.StartsWith("@") != true, $"Parameter '{parameterName}' should starts with '@'");
3030
#else
3131
Throw.ArgumentExceptionIf(parameterName.StartsWith('@') != true, $"Parameter '{parameterName}' should starts with '@'");
@@ -54,7 +54,7 @@ public static SQLiteParameter CreateInputParam(this DbType dbType, string parame
5454
public static SQLiteParameter CreateSourceParam(this DbType dbType, string parameterName, string sourceColumn)
5555
{
5656
Debug.Assert(!string.IsNullOrEmpty(parameterName), $"{nameof(parameterName)} is null or empty");
57-
#if NETFRAMEWORK || NETSTANDARD2_0
57+
#if NET_OLD
5858
Debug.Assert(parameterName?.StartsWith("@") == true, $"Parameter name '{parameterName}' should starts with '@'");
5959
#else
6060
Debug.Assert(parameterName?.StartsWith('@') == true, $"Parameter name '{parameterName}' should starts with '@'");
@@ -66,7 +66,7 @@ public static SQLiteParameter CreateSourceParam(this DbType dbType, string param
6666
Throw.IfNullOrEmpty(parameterName);
6767
Throw.IfNullOrEmpty(sourceColumn);
6868
#endif
69-
#if NETFRAMEWORK || NETSTANDARD2_0
69+
#if NET_OLD
7070
Throw.ArgumentExceptionIf(parameterName.StartsWith("@") != true, $"Parameter '{parameterName}' should starts with '@'");
7171
#else
7272
Throw.ArgumentExceptionIf(parameterName.StartsWith('@') != true, $"Parameter '{parameterName}' should starts with '@'");
@@ -86,7 +86,7 @@ public static SQLiteParameter CreateSourceParam(this DbType dbType, string param
8686
public static SQLiteParameter CreateSourceParam(this DbType dbType, string parameterName, string sourceColumn, DataRowVersion rowVersion)
8787
{
8888
Debug.Assert(!string.IsNullOrEmpty(parameterName), $"{nameof(parameterName)} is null or empty");
89-
#if NETFRAMEWORK || NETSTANDARD2_0
89+
#if NET_OLD
9090
Debug.Assert(parameterName?.StartsWith("@") == true, $"Parameter name '{parameterName}' should starts with '@'");
9191
#else
9292
Debug.Assert(parameterName?.StartsWith('@') == true, $"Parameter name '{parameterName}' should starts with '@'");
@@ -98,7 +98,7 @@ public static SQLiteParameter CreateSourceParam(this DbType dbType, string param
9898
Throw.IfNullOrEmpty(parameterName);
9999
Throw.IfNullOrEmpty(sourceColumn);
100100
#endif
101-
#if NETFRAMEWORK || NETSTANDARD2_0
101+
#if NET_OLD
102102
Throw.ArgumentExceptionIf(parameterName.StartsWith("@") != true, $"Parameter '{parameterName}' should starts with '@'");
103103
#else
104104
Throw.ArgumentExceptionIf(parameterName.StartsWith('@') != true, $"Parameter '{parameterName}' should starts with '@'");

src/System/Data/public static class SQLiteDbConverterExtensions.cs renamed to src/System/Data/SQLiteDbConverterExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public static class SQLiteDbConverterExtensions
77
{
88
public static void Initialize(this IReadOnlyList<SQLiteDbConverter> converters, Func<SQLiteDbConnection> createConnection, CancellationToken cancellationToken)
99
{
10-
#if NET6_0_OR_GREATER
10+
#if NET
1111
ArgumentNullException.ThrowIfNull(converters);
1212
ArgumentNullException.ThrowIfNull(createConnection);
1313
#else
@@ -23,7 +23,7 @@ public static void Initialize(this IReadOnlyList<SQLiteDbConverter> converters,
2323

2424
public static void Initialize(this IReadOnlyList<SQLiteDbConverter> converters, SQLiteDbConnection connection, CancellationToken cancellationToken)
2525
{
26-
#if NET6_0_OR_GREATER
26+
#if NET
2727
ArgumentNullException.ThrowIfNull(converters);
2828
ArgumentNullException.ThrowIfNull(connection);
2929
#else

tests/NuExt.System.Data.SQLite.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="coverlet.collector" Version="6.0.2">
12+
<PackageReference Include="coverlet.collector" Version="6.0.3">
1313
<PrivateAssets>all</PrivateAssets>
1414
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1515
</PackageReference>
1616
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
17-
<PackageReference Include="NUnit" Version="4.2.2" />
18-
<PackageReference Include="NUnit.Analyzers" Version="4.4.0">
17+
<PackageReference Include="NUnit" Version="4.3.2" />
18+
<PackageReference Include="NUnit.Analyzers" Version="4.6.0">
1919
<PrivateAssets>all</PrivateAssets>
2020
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2121
</PackageReference>

0 commit comments

Comments
 (0)