| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | <Project> | |
| 2 | 2 | <!-- Project properties --> | |
| 3 | 3 | <PropertyGroup> | |
| 4 | - <LangVersion>13</LangVersion> | ||
| 4 | + <LangVersion>14</LangVersion> | ||
| 5 | 5 | </PropertyGroup> | |
| 6 | 6 | ||
| 7 | 7 | <!-- NuGet --> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | MIT License | |
| 2 | 2 | ||
| 3 | - Copyright (c) 2024 IvanGit | ||
| 3 | + Copyright (c) 2024-2025 IvanGit | ||
| 4 | 4 | ||
| 5 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 6 | 6 | of this software and associated documentation files (the "Software"), to deal | |
| Original file line number | Diff line number | Diff 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> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,9 +2,10 @@ | |||
| 2 | 2 | ||
| 3 | 3 | <PropertyGroup> | |
| 4 | 4 | <OutputType>Exe</OutputType> | |
| 5 | - <TargetFrameworks>net9.0;net8.0;net6.0;net462</TargetFrameworks> | ||
| 5 | + <TargetFrameworks>net10.0;net9.0;net8.0;net462</TargetFrameworks> | ||
| 6 | 6 | <ImplicitUsings>enable</ImplicitUsings> | |
| 7 | 7 | <Nullable>enable</Nullable> | |
| 8 | + <NoWarn>$(NoWarn);NETSDK1233</NoWarn> | ||
| 8 | 9 | </PropertyGroup> | |
| 9 | 10 | ||
| 10 | 11 | <ItemGroup> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,9 +55,9 @@ public async ValueTask<List<Movie>> GetAllMoviesAsync(CancellationToken cancella | |||
| 55 | 55 | var movie = new Movie() | |
| 56 | 56 | { | |
| 57 | 57 | 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 })] | ||
| 61 | 61 | }; | |
| 62 | 62 | movies.Add(movie); | |
| 63 | 63 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,9 +1,12 @@ | |||
| 1 | 1 | <Project Sdk="Microsoft.NET.Sdk"> | |
| 2 | 2 | ||
| 3 | 3 | <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. --> | ||
| 5 | 7 | <Nullable>enable</Nullable> | |
| 6 | 8 | <ImplicitUsings>enable</ImplicitUsings> | |
| 9 | + <TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors> | ||
| 7 | 10 | <GeneratePackageOnBuild>True</GeneratePackageOnBuild> | |
| 8 | 11 | <PackageTags>nuext;sqlite;database;ado.net;provider;interop;async</PackageTags> | |
| 9 | 12 | <Description>Provides SQLite database engine extensions. | |
@@ -14,25 +17,21 @@ System.Data.SQLite.SQLiteDbConnection | |||
| 14 | 17 | System.Data.SQLite.SQLiteDbContext | |
| 15 | 18 | System.Data.SQLite.SQLiteDbConverter | |
| 16 | 19 | System.Data.SQLite.SQLiteDbTransaction</Description> | |
| 17 | - <Version>0.3.3</Version> | ||
| 20 | + <Version>0.4.0</Version> | ||
| 18 | 21 | <RootNamespace /> | |
| 19 | 22 | <GenerateDocumentationFile>True</GenerateDocumentationFile> | |
| 20 | - <NoWarn>$(NoWarn);1591</NoWarn> | ||
| 23 | + <NoWarn>$(NoWarn);1591;NETSDK1233</NoWarn> | ||
| 21 | 24 | <PackageReadmeFile>README.md</PackageReadmeFile> | |
| 22 | 25 | <PackageIcon>logo128.png</PackageIcon> | |
| 23 | 26 | <PackageProjectUrl>https://github.com/IvanGit/NuExt.System.Data.SQLite</PackageProjectUrl> | |
| 24 | 27 | </PropertyGroup> | |
| 25 | 28 | ||
| 26 | - <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net462'"> | ||
| 27 | - <DefineConstants>$(DefineConstants);NET_OLD</DefineConstants> | ||
| 28 | - </PropertyGroup> | ||
| 29 | - | ||
| 30 | 29 | <ItemGroup> | |
| 31 | 30 | <PackageReference Include="System.Data.SQLite.Core" Version="1.0.119" /> | |
| 32 | 31 | </ItemGroup> | |
| 33 | 32 | ||
| 34 | 33 | <ItemGroup Condition="'$(UseNuExtPackages)' == 'true'"> | |
| 35 | - <PackageReference Include="NuExt.System.Data" Version="0.3.3" /> | ||
| 34 | + <PackageReference Include="NuExt.System.Data" Version="0.4.0" /> | ||
| 36 | 35 | </ItemGroup> | |
| 37 | 36 | ||
| 38 | 37 | <ItemGroup Condition="'$(UseNuExtPackages)' == 'false'"> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -82,7 +82,7 @@ public DataTable Select(SQLiteCommand command, CancellationToken cancellationTok | |||
| 82 | 82 | #region SelectForUpdate | |
| 83 | 83 | ||
| 84 | 84 | [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) | ||
| 86 | 86 | { | |
| 87 | 87 | #if NET8_0_OR_GREATER | |
| 88 | 88 | ArgumentException.ThrowIfNullOrEmpty(tableName); | |
@@ -93,7 +93,7 @@ public DataTable Select(SQLiteCommand command, CancellationToken cancellationTok | |||
| 93 | 93 | } | |
| 94 | 94 | ||
| 95 | 95 | [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) | ||
| 97 | 97 | { | |
| 98 | 98 | #if NET8_0_OR_GREATER | |
| 99 | 99 | ArgumentException.ThrowIfNullOrEmpty(sql); | |
@@ -103,7 +103,7 @@ public DataTable Select(SQLiteCommand command, CancellationToken cancellationTok | |||
| 103 | 103 | return SelectForUpdate(CreateCommand(sql, parameters), generateCommands, cancellationToken); | |
| 104 | 104 | } | |
| 105 | 105 | ||
| 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) | ||
| 107 | 107 | { | |
| 108 | 108 | #if NET6_0_OR_GREATER | |
| 109 | 109 | ArgumentNullException.ThrowIfNull(command); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,21 +15,14 @@ public static class SQLiteParameterExtensions | |||
| 15 | 15 | public static SQLiteParameter CreateInputParam(this DbType dbType, string parameterName, object? objValue = null) | |
| 16 | 16 | { | |
| 17 | 17 | 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 | ||
| 21 | 18 | Debug.Assert(parameterName?.StartsWith('@') == true, $"Parameter name '{parameterName}' should starts with '@'"); | |
| 22 | - #endif | ||
| 23 | 19 | #if NET8_0_OR_GREATER | |
| 24 | 20 | ArgumentException.ThrowIfNullOrEmpty(parameterName); | |
| 25 | 21 | #else | |
| 26 | 22 | Throw.IfNullOrEmpty(parameterName); | |
| 27 | 23 | #endif | |
| 28 | - #if NET_OLD | ||
| 29 | - Throw.ArgumentExceptionIf(parameterName.StartsWith("@") != true, $"Parameter '{parameterName}' should starts with '@'"); | ||
| 30 | - #else | ||
| 31 | 24 | Throw.ArgumentExceptionIf(parameterName.StartsWith('@') != true, $"Parameter '{parameterName}' should starts with '@'"); | |
| 32 | - #endif | ||
| 25 | + | ||
| 33 | 26 | var param = new SQLiteParameter(parameterName, dbType); | |
| 34 | 27 | if (objValue is null) | |
| 35 | 28 | { | |
@@ -54,23 +47,16 @@ public static SQLiteParameter CreateInputParam(this DbType dbType, string parame | |||
| 54 | 47 | public static SQLiteParameter CreateSourceParam(this DbType dbType, string parameterName, string sourceColumn) | |
| 55 | 48 | { | |
| 56 | 49 | 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 | ||
| 60 | 50 | Debug.Assert(parameterName?.StartsWith('@') == true, $"Parameter name '{parameterName}' should starts with '@'"); | |
| 61 | - #endif | ||
| 62 | 51 | #if NET8_0_OR_GREATER | |
| 63 | 52 | ArgumentException.ThrowIfNullOrEmpty(parameterName); | |
| 64 | 53 | ArgumentException.ThrowIfNullOrEmpty(sourceColumn); | |
| 65 | 54 | #else | |
| 66 | 55 | Throw.IfNullOrEmpty(parameterName); | |
| 67 | 56 | Throw.IfNullOrEmpty(sourceColumn); | |
| 68 | 57 | #endif | |
| 69 | - #if NET_OLD | ||
| 70 | - Throw.ArgumentExceptionIf(parameterName.StartsWith("@") != true, $"Parameter '{parameterName}' should starts with '@'"); | ||
| 71 | - #else | ||
| 72 | 58 | Throw.ArgumentExceptionIf(parameterName.StartsWith('@') != true, $"Parameter '{parameterName}' should starts with '@'"); | |
| 73 | - #endif | ||
| 59 | + | ||
| 74 | 60 | return new SQLiteParameter(parameterName, dbType, sourceColumn); | |
| 75 | 61 | } | |
| 76 | 62 | ||
@@ -86,23 +72,16 @@ public static SQLiteParameter CreateSourceParam(this DbType dbType, string param | |||
| 86 | 72 | public static SQLiteParameter CreateSourceParam(this DbType dbType, string parameterName, string sourceColumn, DataRowVersion rowVersion) | |
| 87 | 73 | { | |
| 88 | 74 | 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 | ||
| 92 | 75 | Debug.Assert(parameterName?.StartsWith('@') == true, $"Parameter name '{parameterName}' should starts with '@'"); | |
| 93 | - #endif | ||
| 94 | 76 | #if NET8_0_OR_GREATER | |
| 95 | 77 | ArgumentException.ThrowIfNullOrEmpty(parameterName); | |
| 96 | 78 | ArgumentException.ThrowIfNullOrEmpty(sourceColumn); | |
| 97 | 79 | #else | |
| 98 | 80 | Throw.IfNullOrEmpty(parameterName); | |
| 99 | 81 | Throw.IfNullOrEmpty(sourceColumn); | |
| 100 | 82 | #endif | |
| 101 | - #if NET_OLD | ||
| 102 | - Throw.ArgumentExceptionIf(parameterName.StartsWith("@") != true, $"Parameter '{parameterName}' should starts with '@'"); | ||
| 103 | - #else | ||
| 104 | 83 | Throw.ArgumentExceptionIf(parameterName.StartsWith('@') != true, $"Parameter '{parameterName}' should starts with '@'"); | |
| 105 | - #endif | ||
| 84 | + | ||
| 106 | 85 | return new SQLiteParameter(parameterName, dbType, sourceColumn, rowVersion); | |
| 107 | 86 | } | |
| 108 | 87 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -112,11 +112,11 @@ public void TestInMemory() | |||
| 112 | 112 | } | |
| 113 | 113 | } | |
| 114 | 114 | int num = conn.Update(adapter, table); | |
| 115 | - Assert.Multiple(() => | ||
| 115 | + using (Assert.EnterMultipleScope()) | ||
| 116 | 116 | { | |
| 117 | 117 | Assert.That(expected, Is.EqualTo(7)); | |
| 118 | 118 | Assert.That(num, Is.EqualTo(expected)); | |
| 119 | - }); | ||
| 119 | + } | ||
| 120 | 120 | } | |
| 121 | 121 | table.ClearAndDispose(); | |
| 122 | 122 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,25 +1,26 @@ | |||
| 1 | 1 | <Project Sdk="Microsoft.NET.Sdk"> | |
| 2 | 2 | ||
| 3 | 3 | <PropertyGroup> | |
| 4 | - <TargetFrameworks>net9.0;net8.0;net6.0;net462</TargetFrameworks> | ||
| 4 | + <TargetFrameworks>net10.0;net9.0;net8.0;net462</TargetFrameworks> | ||
| 5 | 5 | <ImplicitUsings>enable</ImplicitUsings> | |
| 6 | 6 | <Nullable>enable</Nullable> | |
| 7 | 7 | <IsPackable>false</IsPackable> | |
| 8 | 8 | <IsTestProject>true</IsTestProject> | |
| 9 | + <NoWarn>$(NoWarn);NETSDK1233</NoWarn> | ||
| 9 | 10 | </PropertyGroup> | |
| 10 | 11 | ||
| 11 | 12 | <ItemGroup> | |
| 12 | 13 | <PackageReference Include="coverlet.collector" Version="6.0.4"> | |
| 13 | 14 | <PrivateAssets>all</PrivateAssets> | |
| 14 | 15 | <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | |
| 15 | 16 | </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"> | ||
| 19 | 20 | <PrivateAssets>all</PrivateAssets> | |
| 20 | 21 | <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | |
| 21 | 22 | </PackageReference> | |
| 22 | - <PackageReference Include="NUnit3TestAdapter" Version="5.0.0" /> | ||
| 23 | + <PackageReference Include="NUnit3TestAdapter" Version="5.2.0" /> | ||
| 23 | 24 | </ItemGroup> | |
| 24 | 25 | ||
| 25 | 26 | <ItemGroup> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments