Skip to content

Commit 0df9400

Browse files
committed
v0.4.0
1 parent 25397ce commit 0df9400

File tree

10 files changed

+33
-48
lines changed

10 files changed

+33
-48
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>13</LangVersion>
4+
<LangVersion>14</LangVersion>
55
</PropertyGroup>
66

77
<!-- NuGet -->

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 IvanGit
3+
Copyright (c) 2024-2025 IvanGit
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

NuExt.System.Data.SQLite.slnx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Solution>
2+
<Project Path="samples/MoviesAppSample/MoviesAppSample.csproj" />
3+
<Project Path="src/NuExt.System.Data.SQLite.csproj" />
4+
<Project Path="tests/NuExt.System.Data.SQLite.Tests.csproj" />
5+
</Solution>

samples/MoviesAppSample/MoviesAppSample.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net9.0;net8.0;net6.0;net462</TargetFrameworks>
5+
<TargetFrameworks>net10.0;net9.0;net8.0;net462</TargetFrameworks>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
8+
<NoWarn>$(NoWarn);NETSDK1233</NoWarn>
89
</PropertyGroup>
910

1011
<ItemGroup>

samples/MoviesAppSample/Services/MoviesService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ public async ValueTask<List<Movie>> GetAllMoviesAsync(CancellationToken cancella
5555
var movie = new Movie()
5656
{
5757
Id = dto.Id, Title = dto.Title, Description = dto.Description, DateReleased = dto.DateReleased,
58-
Starring = starringDtos.Select(p => new Person(){ Id = p.Id, Name = p.Name}).ToList(),
59-
DirectedBy = directedByDtos.Select(p => new Person() { Id = p.Id, Name = p.Name }).ToList(),
60-
ScreenplayBy = screenplayByDtos.Select(p => new Person() { Id = p.Id, Name = p.Name }).ToList()
58+
Starring = [.. starringDtos.Select(p => new Person(){ Id = p.Id, Name = p.Name})],
59+
DirectedBy = [.. directedByDtos.Select(p => new Person() { Id = p.Id, Name = p.Name })],
60+
ScreenplayBy = [.. screenplayByDtos.Select(p => new Person() { Id = p.Id, Name = p.Name })]
6161
};
6262
movies.Add(movie);
6363
}

src/NuExt.System.Data.SQLite.csproj

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.1;netstandard2.0;net9.0;net8.0;net6.0;net462</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.1;netstandard2.0;net10.0;net9.0;net8.0;net471;net462</TargetFrameworks>
5+
<!-- System.ValueTuple is inbox on .NET Framework >= 4.7.1 and therefore any potential redirect for it should be removed.
6+
This is necessary as the assembly version in the already shipped packages is higher than what's provided inbox on .NET Framework. -->
57
<Nullable>enable</Nullable>
68
<ImplicitUsings>enable</ImplicitUsings>
9+
<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>
710
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
811
<PackageTags>nuext;sqlite;database;ado.net;provider;interop;async</PackageTags>
912
<Description>Provides SQLite database engine extensions.
@@ -14,25 +17,21 @@ System.Data.SQLite.SQLiteDbConnection
1417
System.Data.SQLite.SQLiteDbContext
1518
System.Data.SQLite.SQLiteDbConverter
1619
System.Data.SQLite.SQLiteDbTransaction</Description>
17-
<Version>0.3.3</Version>
20+
<Version>0.4.0</Version>
1821
<RootNamespace />
1922
<GenerateDocumentationFile>True</GenerateDocumentationFile>
20-
<NoWarn>$(NoWarn);1591</NoWarn>
23+
<NoWarn>$(NoWarn);1591;NETSDK1233</NoWarn>
2124
<PackageReadmeFile>README.md</PackageReadmeFile>
2225
<PackageIcon>logo128.png</PackageIcon>
2326
<PackageProjectUrl>https://github.com/IvanGit/NuExt.System.Data.SQLite</PackageProjectUrl>
2427
</PropertyGroup>
2528

26-
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net462'">
27-
<DefineConstants>$(DefineConstants);NET_OLD</DefineConstants>
28-
</PropertyGroup>
29-
3029
<ItemGroup>
3130
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.119" />
3231
</ItemGroup>
3332

3433
<ItemGroup Condition="'$(UseNuExtPackages)' == 'true'">
35-
<PackageReference Include="NuExt.System.Data" Version="0.3.3" />
34+
<PackageReference Include="NuExt.System.Data" Version="0.4.0" />
3635
</ItemGroup>
3736

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

src/System/Data/SQLite/SQLiteDbConnection.Adapters.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public DataTable Select(SQLiteCommand command, CancellationToken cancellationTok
8282
#region SelectForUpdate
8383

8484
[MethodImpl(MethodImplOptions.AggressiveInlining)]
85-
public (SQLiteDataAdapter, DataTable) SelectForUpdate(string tableName, IEnumerable<string> fields, string? expr = null, bool generateCommands = true, CancellationToken cancellationToken = default, params SQLiteParameter[] parameters)
85+
public (SQLiteDataAdapter Adapter, DataTable Table) SelectForUpdate(string tableName, IEnumerable<string> fields, string? expr = null, bool generateCommands = true, CancellationToken cancellationToken = default, params SQLiteParameter[] parameters)
8686
{
8787
#if NET8_0_OR_GREATER
8888
ArgumentException.ThrowIfNullOrEmpty(tableName);
@@ -93,7 +93,7 @@ public DataTable Select(SQLiteCommand command, CancellationToken cancellationTok
9393
}
9494

9595
[MethodImpl(MethodImplOptions.AggressiveInlining)]
96-
public (SQLiteDataAdapter, DataTable) SelectForUpdate(string sql, bool generateCommands = true, CancellationToken cancellationToken = default, params SQLiteParameter[] parameters)
96+
public (SQLiteDataAdapter Adapter, DataTable Table) SelectForUpdate(string sql, bool generateCommands = true, CancellationToken cancellationToken = default, params SQLiteParameter[] parameters)
9797
{
9898
#if NET8_0_OR_GREATER
9999
ArgumentException.ThrowIfNullOrEmpty(sql);
@@ -103,7 +103,7 @@ public DataTable Select(SQLiteCommand command, CancellationToken cancellationTok
103103
return SelectForUpdate(CreateCommand(sql, parameters), generateCommands, cancellationToken);
104104
}
105105

106-
public (SQLiteDataAdapter, DataTable) SelectForUpdate(SQLiteCommand command, bool generateCommands = true, CancellationToken cancellationToken = default)
106+
public (SQLiteDataAdapter Adapter, DataTable Table) SelectForUpdate(SQLiteCommand command, bool generateCommands = true, CancellationToken cancellationToken = default)
107107
{
108108
#if NET6_0_OR_GREATER
109109
ArgumentNullException.ThrowIfNull(command);

src/System/Data/SQLite/SQLiteParameterExtensions.cs

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,14 @@ 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 NET_OLD
19-
Debug.Assert(parameterName?.StartsWith("@") == true, $"Parameter name '{parameterName}' should starts with '@'");
20-
#else
2118
Debug.Assert(parameterName?.StartsWith('@') == true, $"Parameter name '{parameterName}' should starts with '@'");
22-
#endif
2319
#if NET8_0_OR_GREATER
2420
ArgumentException.ThrowIfNullOrEmpty(parameterName);
2521
#else
2622
Throw.IfNullOrEmpty(parameterName);
2723
#endif
28-
#if NET_OLD
29-
Throw.ArgumentExceptionIf(parameterName.StartsWith("@") != true, $"Parameter '{parameterName}' should starts with '@'");
30-
#else
3124
Throw.ArgumentExceptionIf(parameterName.StartsWith('@') != true, $"Parameter '{parameterName}' should starts with '@'");
32-
#endif
25+
3326
var param = new SQLiteParameter(parameterName, dbType);
3427
if (objValue is null)
3528
{
@@ -54,23 +47,16 @@ public static SQLiteParameter CreateInputParam(this DbType dbType, string parame
5447
public static SQLiteParameter CreateSourceParam(this DbType dbType, string parameterName, string sourceColumn)
5548
{
5649
Debug.Assert(!string.IsNullOrEmpty(parameterName), $"{nameof(parameterName)} is null or empty");
57-
#if NET_OLD
58-
Debug.Assert(parameterName?.StartsWith("@") == true, $"Parameter name '{parameterName}' should starts with '@'");
59-
#else
6050
Debug.Assert(parameterName?.StartsWith('@') == true, $"Parameter name '{parameterName}' should starts with '@'");
61-
#endif
6251
#if NET8_0_OR_GREATER
6352
ArgumentException.ThrowIfNullOrEmpty(parameterName);
6453
ArgumentException.ThrowIfNullOrEmpty(sourceColumn);
6554
#else
6655
Throw.IfNullOrEmpty(parameterName);
6756
Throw.IfNullOrEmpty(sourceColumn);
6857
#endif
69-
#if NET_OLD
70-
Throw.ArgumentExceptionIf(parameterName.StartsWith("@") != true, $"Parameter '{parameterName}' should starts with '@'");
71-
#else
7258
Throw.ArgumentExceptionIf(parameterName.StartsWith('@') != true, $"Parameter '{parameterName}' should starts with '@'");
73-
#endif
59+
7460
return new SQLiteParameter(parameterName, dbType, sourceColumn);
7561
}
7662

@@ -86,23 +72,16 @@ public static SQLiteParameter CreateSourceParam(this DbType dbType, string param
8672
public static SQLiteParameter CreateSourceParam(this DbType dbType, string parameterName, string sourceColumn, DataRowVersion rowVersion)
8773
{
8874
Debug.Assert(!string.IsNullOrEmpty(parameterName), $"{nameof(parameterName)} is null or empty");
89-
#if NET_OLD
90-
Debug.Assert(parameterName?.StartsWith("@") == true, $"Parameter name '{parameterName}' should starts with '@'");
91-
#else
9275
Debug.Assert(parameterName?.StartsWith('@') == true, $"Parameter name '{parameterName}' should starts with '@'");
93-
#endif
9476
#if NET8_0_OR_GREATER
9577
ArgumentException.ThrowIfNullOrEmpty(parameterName);
9678
ArgumentException.ThrowIfNullOrEmpty(sourceColumn);
9779
#else
9880
Throw.IfNullOrEmpty(parameterName);
9981
Throw.IfNullOrEmpty(sourceColumn);
10082
#endif
101-
#if NET_OLD
102-
Throw.ArgumentExceptionIf(parameterName.StartsWith("@") != true, $"Parameter '{parameterName}' should starts with '@'");
103-
#else
10483
Throw.ArgumentExceptionIf(parameterName.StartsWith('@') != true, $"Parameter '{parameterName}' should starts with '@'");
105-
#endif
84+
10685
return new SQLiteParameter(parameterName, dbType, sourceColumn, rowVersion);
10786
}
10887
}

tests/InMemoryTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ public void TestInMemory()
112112
}
113113
}
114114
int num = conn.Update(adapter, table);
115-
Assert.Multiple(() =>
115+
using (Assert.EnterMultipleScope())
116116
{
117117
Assert.That(expected, Is.EqualTo(7));
118118
Assert.That(num, Is.EqualTo(expected));
119-
});
119+
}
120120
}
121121
table.ClearAndDispose();
122122

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net9.0;net8.0;net6.0;net462</TargetFrameworks>
4+
<TargetFrameworks>net10.0;net9.0;net8.0;net462</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<IsPackable>false</IsPackable>
88
<IsTestProject>true</IsTestProject>
9+
<NoWarn>$(NoWarn);NETSDK1233</NoWarn>
910
</PropertyGroup>
1011

1112
<ItemGroup>
1213
<PackageReference Include="coverlet.collector" Version="6.0.4">
1314
<PrivateAssets>all</PrivateAssets>
1415
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1516
</PackageReference>
16-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
17-
<PackageReference Include="NUnit" Version="4.3.2" />
18-
<PackageReference Include="NUnit.Analyzers" Version="4.6.0">
17+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
18+
<PackageReference Include="NUnit" Version="4.4.0" />
19+
<PackageReference Include="NUnit.Analyzers" Version="4.11.2">
1920
<PrivateAssets>all</PrivateAssets>
2021
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2122
</PackageReference>
22-
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
23+
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
2324
</ItemGroup>
2425

2526
<ItemGroup>

0 commit comments

Comments
 (0)