diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7b47e6567..05564a738 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,6 +1,10 @@
name: CI
-on: [push, pull_request]
+on:
+ push:
+ branches:
+ - master
+ pull_request:
env:
CONFIGURATION: Release
@@ -8,7 +12,7 @@ env:
jobs:
ci:
- runs-on: windows-2022
+ runs-on: windows-2025
strategy:
fail-fast: false
matrix:
@@ -17,12 +21,12 @@ jobs:
timeout-minutes: 120
steps:
- name: Checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@v5
- - name: .NET 9.0
- uses: actions/setup-dotnet@v4
+ - name: .NET 11.0
+ uses: actions/setup-dotnet@v5
with:
- dotnet-version: 9.0.x
+ dotnet-version: 11.0.x
- name: Build
run: |
@@ -51,7 +55,7 @@ jobs:
shell: powershell
- name: Publish Artifacts
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v7
with:
name: 'ci_${{ matrix.TEST_SUITE }}_${{ matrix.FIREBIRD_SELECTION }}_${{ env.CONFIGURATION }}'
path: '.\\out\\'
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c7142416e..8bc7ccd07 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,16 +2,16 @@
Thanks for considering contributing. Here are some items to consider before starting (in no particular order).
-* Check [tracker](https://github.com/FirebirdSQL/NETProvider/issues) if you want to start on something.
-* Before you start working on something announce your intention on the mailing list (or in comment in tracker).
+* Check [issues](https://github.com/FirebirdSQL/NETProvider/issues) if you want to start on something.
+* Before you start working on something announce your intention on the mailing list (or comment on the issue).
* Issue only complete PRs (no WIPs).
* Make sure your PR doesn't contain unneccessary changes (whitespaces, new lines, ...).
-* Consider squashing your commits.
* Follow existing code formatting/styling (even for new files).
+* Disclose AI usage.
* Make sure you swept all corners (i.e. all build configurations are fine, works with all Firebird version, etc.).
* Make sure your changes merge without conflicts.
* Consider backward compatibility.
* Don't be afraid to ask (i.e. backward compatibility).
* Be prepared to do some changes after your PR is reviewed.
* Consider whether your change is benefit for majority of users (opposite to only a small group).
-* All contributions are licensed under [_Initial Developer's Public License_](license.txt).
\ No newline at end of file
+* All contributions are licensed under [_Initial Developer's Public License_](license.txt).
diff --git a/README.md b/README.md
index 8949c0d75..7d5f084d1 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,7 @@
* [Downloads](https://github.com/FirebirdSQL/NETProvider/releases)
* [Issue tracker](https://github.com/FirebirdSQL/NETProvider/issues)
* [Development mailing list](https://groups.google.com/forum/#!forum/firebird-net-provider)
+* [](https://deepwiki.com/FirebirdSQL/NETProvider)
## Builds
diff --git a/build.ps1 b/build.ps1
index 9a321609d..107e31086 100644
--- a/build.ps1
+++ b/build.ps1
@@ -20,25 +20,16 @@ function Clean() {
}
function Build() {
- function b($target, $check=$True) {
- dotnet msbuild /t:$target /p:Configuration=$Configuration /p:ContinuousIntegrationBuild=true "$baseDir\src\NETProvider.sln" /v:m /m
- if ($check) {
- Check-ExitCode
- }
- }
- b 'Clean'
- # this sometimes fails on CI
- b 'Restore' $False
- b 'Restore'
- b 'Build'
+ dotnet clean "$baseDir\src\NETProvider.slnx" -c $Configuration -v m
+ dotnet build "$baseDir\src\NETProvider.slnx" -c $Configuration -p:ContinuousIntegrationBuild=true -v m
}
function Versions() {
function v($file) {
return (Get-Item $file).VersionInfo.ProductVersion -replace '(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+)?.*','$1.$2.$3$4'
}
- $script:versionProvider = v $baseDir\src\FirebirdSql.Data.FirebirdClient\bin\$Configuration\net8.0\FirebirdSql.Data.FirebirdClient.dll
- $script:versionEFCore = v $baseDir\src\FirebirdSql.EntityFrameworkCore.Firebird\bin\$Configuration\net8.0\FirebirdSql.EntityFrameworkCore.Firebird.dll
+ $script:versionProvider = v $baseDir\src\FirebirdSql.Data.FirebirdClient\bin\$Configuration\net11.0\FirebirdSql.Data.FirebirdClient.dll
+ $script:versionEFCore = v $baseDir\src\FirebirdSql.EntityFrameworkCore.Firebird\bin\$Configuration\net11.0\FirebirdSql.EntityFrameworkCore.Firebird.dll
$script:versionEF6 = v $baseDir\src\EntityFramework.Firebird\bin\$Configuration\net48\EntityFramework.Firebird.dll
}
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index 183e41420..5bfad44f0 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -20,7 +20,7 @@
license.txt
- 2025
+ 2026
@@ -29,7 +29,7 @@
true
-
+
all
runtime; build; native; contentfiles; analyzers
diff --git a/src/EntityFramework.Firebird.Tests/EntityFramework.Firebird.Tests.csproj b/src/EntityFramework.Firebird.Tests/EntityFramework.Firebird.Tests.csproj
index c3eb7d657..eb7e6918a 100644
--- a/src/EntityFramework.Firebird.Tests/EntityFramework.Firebird.Tests.csproj
+++ b/src/EntityFramework.Firebird.Tests/EntityFramework.Firebird.Tests.csproj
@@ -1,6 +1,6 @@
- net9.0
+ net11.0
false
false
true
@@ -16,7 +16,7 @@
-
+
diff --git a/src/EntityFramework.Firebird/EntityFramework.Firebird.csproj b/src/EntityFramework.Firebird/EntityFramework.Firebird.csproj
index 7a028340b..12ec50978 100644
--- a/src/EntityFramework.Firebird/EntityFramework.Firebird.csproj
+++ b/src/EntityFramework.Firebird/EntityFramework.Firebird.csproj
@@ -47,6 +47,7 @@
+
@@ -54,10 +55,4 @@
-
-
-
-
-
-
diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/FbDecFloatTypeTests.cs b/src/FirebirdSql.Data.FirebirdClient.Tests/FbDecFloatTypeTests.cs
index b2775d6c1..4df15b2d5 100644
--- a/src/FirebirdSql.Data.FirebirdClient.Tests/FbDecFloatTypeTests.cs
+++ b/src/FirebirdSql.Data.FirebirdClient.Tests/FbDecFloatTypeTests.cs
@@ -38,6 +38,7 @@ public class FbDecFloatTypeTests
new object[] { new FbDecFloat(-10, 3), new FbDecFloat(-100, 2) },
new object[] { new FbDecFloat(10, -3), new FbDecFloat(1, -2) },
new object[] { new FbDecFloat(-10, -3), new FbDecFloat(-1, -2) },
+ new object[] { new FbDecFloat(0, 0), new FbDecFloat(0, 5) },
new object[] { FbDecFloat.PositiveInfinity, FbDecFloat.PositiveInfinity },
new object[] { FbDecFloat.NegativeInfinity, FbDecFloat.NegativeInfinity },
new object[] { FbDecFloat.PositiveNaN, FbDecFloat.PositiveNaN },
@@ -48,11 +49,19 @@ public void EqualityTrue(FbDecFloat expected, FbDecFloat actual)
Assert.AreEqual(expected, actual);
}
+ [TestCaseSource(nameof(SimpleEqualityTrueSource))]
+ public void HashCodeEqual(FbDecFloat expected, FbDecFloat actual)
+ {
+ Assert.AreEqual(expected.GetHashCode(), actual.GetHashCode());
+ }
+
static readonly object[] SimpleEqualityFalseSource = new object[]
{
new object[] { new FbDecFloat(0), new FbDecFloat(BigInteger.Parse("986767875675879890678765756798079808709")) },
new object[] { new FbDecFloat(6, 3), new FbDecFloat(-6, 3) },
new object[] { new FbDecFloat(6, 3), new FbDecFloat(6, -3) },
+ new object[] { new FbDecFloat(1, 0), new FbDecFloat(1, 1_000_000_000) },
+ new object[] { new FbDecFloat(1, int.MaxValue), new FbDecFloat(1, int.MinValue) },
new object[] { FbDecFloat.PositiveInfinity, FbDecFloat.NegativeInfinity },
new object[] { FbDecFloat.PositiveNaN, FbDecFloat.NegativeNaN },
new object[] { FbDecFloat.PositiveInfinity, FbDecFloat.PositiveNaN },
diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/FbParameterCollectionTests.cs b/src/FirebirdSql.Data.FirebirdClient.Tests/FbParameterCollectionTests.cs
index 9fa3617e7..9efd0ad1b 100644
--- a/src/FirebirdSql.Data.FirebirdClient.Tests/FbParameterCollectionTests.cs
+++ b/src/FirebirdSql.Data.FirebirdClient.Tests/FbParameterCollectionTests.cs
@@ -26,6 +26,29 @@ namespace FirebirdSql.Data.FirebirdClient.Tests;
[NoServerCategory]
public class FbParameterCollectionTests
{
+ [TestCase(-1)]
+ [TestCase(0)]
+ [TestCase(1)]
+ public void RemoveAtInvalidIndexThrowsArgumentOutOfRangeTest(int index)
+ {
+ var command = new FbCommand();
+ if (index == 1)
+ {
+ command.Parameters.Add("@p1", 1);
+ }
+
+ var ex = Assert.Throws(() => command.Parameters.RemoveAt(index));
+ Assert.AreEqual("index", ex.ParamName);
+ Assert.AreEqual(index == 1 ? 1 : 0, command.Parameters.Count);
+ }
+
+ [Test]
+ public void RemoveAtUnknownNameThrowsIndexOutOfRangeTest()
+ {
+ var command = new FbCommand();
+ Assert.Throws(() => command.Parameters.RemoveAt("@missing"));
+ }
+
[Test]
public void AddTest()
{
diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/FbTimeZonesSupportTests.cs b/src/FirebirdSql.Data.FirebirdClient.Tests/FbTimeZonesSupportTests.cs
index d2caca40a..41d0a5c43 100644
--- a/src/FirebirdSql.Data.FirebirdClient.Tests/FbTimeZonesSupportTests.cs
+++ b/src/FirebirdSql.Data.FirebirdClient.Tests/FbTimeZonesSupportTests.cs
@@ -58,6 +58,24 @@ public async Task ReadsZonedDateTimeCorrectly(bool isExtended)
}
}
+ [TestCase(true)]
+ [TestCase(false)]
+ public async Task ReadsZonedDateTimeWithOffsetCorrectly(bool isExtended)
+ {
+ if (isExtended)
+ {
+ await SetExtended();
+ }
+ await using (var cmd = Connection.CreateCommand())
+ {
+ cmd.CommandText = "select cast('2020-08-27 10:00 +01:00' as timestamp with time zone) from rdb$database";
+ var result = (FbZonedDateTime)await cmd.ExecuteScalarAsync();
+ Assert.AreEqual(new DateTime(2020, 08, 27, 09, 00, 00, DateTimeKind.Utc), result.DateTime);
+ Assert.AreEqual("+01:00", result.TimeZone);
+ Assert.AreEqual(isExtended ? TimeSpan.FromMinutes(60) : (TimeSpan?)null, result.Offset);
+ }
+ }
+
[TestCase(true)]
[TestCase(false)]
public async Task ReadsZonedDateTimeNullCorrectly(bool isExtended)
@@ -92,6 +110,25 @@ public async Task PassesZonedDateTimeCorrectly(bool isExtended)
}
}
+ [TestCase(true)]
+ [TestCase(false)]
+ public async Task PassesZonedDateTimeWithOffsetCorrectly(bool isExtended)
+ {
+ if (isExtended)
+ {
+ await SetExtended();
+ }
+ var value = new FbZonedDateTime(new DateTime(2020, 08, 27, 08, 00, 00, DateTimeKind.Utc), "-5:30");
+ await using (var cmd = Connection.CreateCommand())
+ {
+ cmd.CommandText = "select cast(@value as timestamp with time zone) from rdb$database";
+ cmd.Parameters.AddWithValue("value", value);
+ var result = (FbZonedDateTime)await cmd.ExecuteScalarAsync();
+ Assert.AreEqual(value, result);
+ Assert.AreEqual("-05:30", result.TimeZone);
+ }
+ }
+
[TestCase(true)]
[TestCase(false)]
public async Task PassesZonedDateTimeNullCorrectly(bool isExtended)
@@ -127,6 +164,24 @@ public async Task ReadsZonedTimeCorrectly(bool isExtended)
}
}
+ [TestCase(true)]
+ [TestCase(false)]
+ public async Task ReadsZonedTimeWithOffsetCorrectly(bool isExtended)
+ {
+ if (isExtended)
+ {
+ await SetExtended();
+ }
+ await using (var cmd = Connection.CreateCommand())
+ {
+ cmd.CommandText = "select cast('15:00 -05:30' as time with time zone) from rdb$database";
+ var result = (FbZonedTime)await cmd.ExecuteScalarAsync();
+ Assert.AreEqual(new TimeSpan(20, 30, 00), result.Time);
+ Assert.AreEqual("-05:30", result.TimeZone);
+ Assert.AreEqual(isExtended ? TimeSpan.FromMinutes(-330) : (TimeSpan?)null, result.Offset);
+ }
+ }
+
[TestCase(true)]
[TestCase(false)]
public async Task ReadsZonedTimeNullCorrectly(bool isExtended)
diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedDateTimeTypeTests.cs b/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedDateTimeTypeTests.cs
index b69dc7044..0edc9c064 100644
--- a/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedDateTimeTypeTests.cs
+++ b/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedDateTimeTypeTests.cs
@@ -29,6 +29,7 @@ public class FbZonedDateTimeTypeTests
{
new object[] { new FbZonedDateTime(new DateTime(2020, 12, 4, 10, 38, 0, DateTimeKind.Utc), "UTC"), new FbZonedDateTime(new DateTime(2020, 12, 4, 10, 38, 0, DateTimeKind.Utc), "UTC") },
new object[] { new FbZonedDateTime(new DateTime(2020, 12, 4, 10, 38, 0, DateTimeKind.Utc), "UTC"), new FbZonedDateTime(new DateTime(2020, 12, 4, 10, 38, 0, DateTimeKind.Utc), "utc") },
+ new object[] { new FbZonedDateTime(new DateTime(2020, 12, 4, 10, 38, 0, DateTimeKind.Utc), "UTC"), new FbZonedDateTime(new DateTime(2020, 12, 4, 10, 38, 0, DateTimeKind.Utc), "UTC", TimeSpan.Zero) },
};
[TestCaseSource(nameof(SimpleEqualityTrueSource))]
public void EqualityTrue(FbZonedDateTime expected, FbZonedDateTime actual)
@@ -36,6 +37,12 @@ public void EqualityTrue(FbZonedDateTime expected, FbZonedDateTime actual)
Assert.AreEqual(expected, actual);
}
+ [TestCaseSource(nameof(SimpleEqualityTrueSource))]
+ public void HashCodeEqual(FbZonedDateTime expected, FbZonedDateTime actual)
+ {
+ Assert.AreEqual(expected.GetHashCode(), actual.GetHashCode());
+ }
+
static readonly object[] SimpleEqualityFalseSource = new object[]
{
new object[] { new FbZonedDateTime(new DateTime(2020, 12, 4, 10, 38, 0, DateTimeKind.Utc), "UTC"), new FbZonedDateTime(new DateTime(2020, 12, 4, 10, 38, 1, DateTimeKind.Utc), "UTC") },
@@ -47,6 +54,13 @@ public void EqualityFalse(FbZonedDateTime expected, FbZonedDateTime actual)
Assert.AreNotEqual(expected, actual);
}
+ [TestCase("-5:0", "-05:00")]
+ [TestCase("europe/prague", "Europe/Prague")]
+ public void TimeZoneIsNormalized(string timeZone, string expected)
+ {
+ Assert.AreEqual(expected, new FbZonedDateTime(new DateTime(2020, 12, 4, 10, 38, 0, DateTimeKind.Utc), timeZone).TimeZone);
+ }
+
[Test]
public void ConvertToDateTimeShouldNotThrow()
{
diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedTimeTypeTests.cs b/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedTimeTypeTests.cs
index 959c2a579..94791695b 100644
--- a/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedTimeTypeTests.cs
+++ b/src/FirebirdSql.Data.FirebirdClient.Tests/FbZonedTimeTypeTests.cs
@@ -29,6 +29,7 @@ public class FbZonedTimeTypeTests
{
new object[] { new FbZonedTime(TimeSpan.FromMinutes(142), "UTC"), new FbZonedTime(TimeSpan.FromMinutes(142), "UTC") },
new object[] { new FbZonedTime(TimeSpan.FromMinutes(142), "UTC"), new FbZonedTime(TimeSpan.FromMinutes(142), "utc") },
+ new object[] { new FbZonedTime(TimeSpan.FromMinutes(142), "UTC"), new FbZonedTime(TimeSpan.FromMinutes(142), "UTC", TimeSpan.Zero) },
};
[TestCaseSource(nameof(SimpleEqualityTrueSource))]
public void EqualityTrue(FbZonedTime expected, FbZonedTime actual)
@@ -36,6 +37,12 @@ public void EqualityTrue(FbZonedTime expected, FbZonedTime actual)
Assert.AreEqual(expected, actual);
}
+ [TestCaseSource(nameof(SimpleEqualityTrueSource))]
+ public void HashCodeEqual(FbZonedTime expected, FbZonedTime actual)
+ {
+ Assert.AreEqual(expected.GetHashCode(), actual.GetHashCode());
+ }
+
static readonly object[] SimpleEqualityFalseSource = new object[]
{
new object[] { new FbZonedTime(TimeSpan.FromMinutes(142), "UTC"), new FbZonedTime(TimeSpan.FromMinutes(141), "UTC") },
@@ -47,6 +54,13 @@ public void EqualityFalse(FbZonedTime expected, FbZonedTime actual)
Assert.AreNotEqual(expected, actual);
}
+ [TestCase("-5:0", "-05:00")]
+ [TestCase("europe/prague", "Europe/Prague")]
+ public void TimeZoneIsNormalized(string timeZone, string expected)
+ {
+ Assert.AreEqual(expected, new FbZonedTime(TimeSpan.FromMinutes(142), timeZone).TimeZone);
+ }
+
[Test]
public void ConvertToTimeSpanShouldNotThrow()
{
diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/FirebirdSql.Data.FirebirdClient.Tests.csproj b/src/FirebirdSql.Data.FirebirdClient.Tests/FirebirdSql.Data.FirebirdClient.Tests.csproj
index 1fe8ead88..53c35f12b 100644
--- a/src/FirebirdSql.Data.FirebirdClient.Tests/FirebirdSql.Data.FirebirdClient.Tests.csproj
+++ b/src/FirebirdSql.Data.FirebirdClient.Tests/FirebirdSql.Data.FirebirdClient.Tests.csproj
@@ -1,6 +1,6 @@
- net9.0
+ net11.0
false
false
true
diff --git a/src/FirebirdSql.Data.FirebirdClient.Tests/TimeZoneMappingTests.cs b/src/FirebirdSql.Data.FirebirdClient.Tests/TimeZoneMappingTests.cs
new file mode 100644
index 000000000..de2c38bc4
--- /dev/null
+++ b/src/FirebirdSql.Data.FirebirdClient.Tests/TimeZoneMappingTests.cs
@@ -0,0 +1,66 @@
+/*
+ * The contents of this file are subject to the Initial
+ * Developer's Public License Version 1.0 (the "License");
+ * you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ * https://github.com/FirebirdSQL/NETProvider/raw/master/license.txt.
+ *
+ * Software distributed under the License is distributed on
+ * an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
+ * express or implied. See the License for the specific
+ * language governing rights and limitations under the License.
+ *
+ * All Rights Reserved.
+ */
+
+//$Authors = Jiri Cincura (jiri@cincura.net)
+
+using FirebirdSql.Data.Common;
+using FirebirdSql.Data.TestsBase;
+using NUnit.Framework;
+
+namespace FirebirdSql.Data.FirebirdClient.Tests;
+
+[NoServerCategory]
+public class TimeZoneMappingTests
+{
+ [TestCase((ushort)599, "-14:00")]
+ [TestCase((ushort)1439, "+00:00")]
+ [TestCase((ushort)1499, "+01:00")]
+ [TestCase((ushort)2279, "+14:00")]
+ [TestCase((ushort)65059, "Europe/Prague")]
+ public void TryGetById(ushort id, string expected)
+ {
+ Assert.IsTrue(TimeZoneMapping.TryGetById(id, out var name));
+ Assert.AreEqual(expected, name);
+ }
+
+ [TestCase("+01:00", (ushort)1499)]
+ [TestCase("Europe/Prague", (ushort)65059)]
+ [TestCase("europe/prague", (ushort)65059)]
+ public void TryGetByName(string name, ushort expected)
+ {
+ Assert.IsTrue(TimeZoneMapping.TryGetByName(name, out var id));
+ Assert.AreEqual(expected, id);
+ }
+
+ [TestCase("+01:00", "+01:00")]
+ [TestCase("+1:00", "+01:00")]
+ [TestCase("+1", "+01:00")]
+ [TestCase("-5:0", "-05:00")]
+ [TestCase(" - 05 : 30 ", "-05:30")]
+ [TestCase("-00:00", "+00:00")]
+ [TestCase("+001:00", "+01:00")]
+ [TestCase("-14:00", "-14:00")]
+ [TestCase("europe/prague", "Europe/Prague")]
+ [TestCase("+14:01", "+14:01")]
+ [TestCase("+15:00", "+15:00")]
+ [TestCase("+01:60", "+01:60")]
+ [TestCase("+99999999999:00", "+99999999999:00")]
+ [TestCase("+01:00x", "+01:00x")]
+ [TestCase("Europe/Nowhere", "Europe/Nowhere")]
+ public void Normalize(string name, string expected)
+ {
+ Assert.AreEqual(expected, TimeZoneMapping.Normalize(name));
+ }
+}
diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/ClientFactory.cs b/src/FirebirdSql.Data.FirebirdClient/Client/ClientFactory.cs
index a3869d1b3..c6ff43285 100644
--- a/src/FirebirdSql.Data.FirebirdClient/Client/ClientFactory.cs
+++ b/src/FirebirdSql.Data.FirebirdClient/Client/ClientFactory.cs
@@ -128,7 +128,7 @@ private static ValueTask CreateNativeDatabaseAsync(ConnectionStrin
{
var charset = GetCharset(options);
- return ValueTask2.FromResult(new Native.FesDatabase(options.ClientLibrary, charset, options.PacketSize, options.Dialect));
+ return ValueTask.FromResult(new Native.FesDatabase(options.ClientLibrary, charset, options.PacketSize, options.Dialect));
}
private static ServiceManagerBase CreateManagedServiceManager(ConnectionString options)
@@ -194,7 +194,7 @@ private static ValueTask CreateNativeServiceManagerAsync(Con
{
var charset = GetCharset(options);
- return ValueTask2.FromResult(new Native.FesServiceManager(options.ClientLibrary, charset));
+ return ValueTask.FromResult(new Native.FesServiceManager(options.ClientLibrary, charset));
}
private static Exception UnsupportedProtocolException() => new NotSupportedException("Protocol not supported.");
diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/FirebirdNetworkHandlingWrapper.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/FirebirdNetworkHandlingWrapper.cs
index 28d85b36f..17f068a30 100644
--- a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/FirebirdNetworkHandlingWrapper.cs
+++ b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/FirebirdNetworkHandlingWrapper.cs
@@ -122,14 +122,14 @@ public async ValueTask ReadAsync(byte[] buffer, int offset, int count, Canc
public void Write(byte[] buffer, int offset, int count)
{
- for (var i = offset; i < count; i++)
+ for (var i = 0; i < count; i++)
_outputBuffer.Enqueue(buffer[offset + i]);
}
public ValueTask WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken = default)
{
- for (var i = offset; i < count; i++)
+ for (var i = 0; i < count; i++)
_outputBuffer.Enqueue(buffer[offset + i]);
- return ValueTask2.CompletedTask;
+ return ValueTask.CompletedTask;
}
public void Flush()
diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/GdsConnection.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/GdsConnection.cs
index 249f31fb7..cc39ba6b2 100644
--- a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/GdsConnection.cs
+++ b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/GdsConnection.cs
@@ -114,12 +114,7 @@ public async ValueTask ConnectAsync(CancellationToken cancellationToken = defaul
{
using (var combinedCts = CancellationTokenSource.CreateLinkedTokenSource(timeoutCts.Token, cancellationToken))
{
-#if NET48 || NETSTANDARD2_0 || NETSTANDARD2_1
- static Func ConnectAsyncHelper(Socket socket) => (e, ct) => Task.Factory.FromAsync(socket.BeginConnect, socket.EndConnect, e, null);
-#else
- static Func ConnectAsyncHelper(Socket socket) => (e, ct) => SocketTaskExtensions.ConnectAsync(socket, e, ct).AsTask();
-#endif
- await ConnectAsyncHelper(socket)(endPoint, combinedCts.Token).ConfigureAwait(false);
+ await socket.ConnectAsync(endPoint, combinedCts.Token).ConfigureAwait(false);
}
}
@@ -366,11 +361,7 @@ public void Disconnect()
{
if (_networkStream != null)
{
-#if NET48 || NETSTANDARD2_0
_networkStream.Dispose();
-#else
- _networkStream.Dispose();
-#endif
_networkStream = null;
}
}
@@ -378,12 +369,7 @@ public async ValueTask DisconnectAsync(CancellationToken cancellationToken = def
{
if (_networkStream != null)
{
-#if NET48 || NETSTANDARD2_0
- _networkStream.Dispose();
- await ValueTask2.CompletedTask.ConfigureAwait(false);
-#else
await _networkStream.DisposeAsync().ConfigureAwait(false);
-#endif
_networkStream = null;
}
}
diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsDatabase.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsDatabase.cs
index 6e9e209ba..37f134aa1 100644
--- a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsDatabase.cs
+++ b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsDatabase.cs
@@ -159,7 +159,7 @@ protected virtual void ProcessAttachResponse(GenericResponse response)
protected virtual ValueTask ProcessAttachResponseAsync(GenericResponse response, CancellationToken cancellationToken = default)
{
_handle = response.ObjectHandle;
- return ValueTask2.CompletedTask;
+ return ValueTask.CompletedTask;
}
protected void AfterAttachActions()
@@ -353,7 +353,7 @@ protected void ProcessCreateResponse(GenericResponse response)
protected ValueTask ProcessCreateResponseAsync(GenericResponse response, CancellationToken cancellationToken = default)
{
_handle = response.ObjectHandle;
- return ValueTask2.CompletedTask;
+ return ValueTask.CompletedTask;
}
public override void CreateDatabaseWithTrustedAuth(DatabaseParameterBufferBase dpb, string database, byte[] cryptKey)
@@ -784,7 +784,7 @@ protected virtual void ProcessReleaseObjectResponse(IResponse response)
{ }
protected virtual ValueTask ProcessReleaseObjectResponseAsync(IResponse response, CancellationToken cancellationToken = default)
{
- return ValueTask2.CompletedTask;
+ return ValueTask.CompletedTask;
}
#endregion
diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsServiceManager.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsServiceManager.cs
index d0f7bf057..20fb3b9cb 100644
--- a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsServiceManager.cs
+++ b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsServiceManager.cs
@@ -113,7 +113,7 @@ protected virtual void ProcessAttachResponse(GenericResponse response)
protected virtual ValueTask ProcessAttachResponseAsync(GenericResponse response, CancellationToken cancellationToken = default)
{
Handle = response.ObjectHandle;
- return ValueTask2.CompletedTask;
+ return ValueTask.CompletedTask;
}
public override void Detach()
diff --git a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsStatement.cs b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsStatement.cs
index f6d33d155..54b5698cc 100644
--- a/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsStatement.cs
+++ b/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsStatement.cs
@@ -191,7 +191,7 @@ public override ArrayBase CreateArray(ArrayDesc descriptor)
public override ValueTask CreateArrayAsync(ArrayDesc descriptor, CancellationToken cancellationToken = default)
{
var array = new GdsArray(descriptor);
- return ValueTask2.FromResult(array);
+ return ValueTask.FromResult(array);
}
public override ArrayBase CreateArray(string tableName, string fieldName)
@@ -643,7 +643,7 @@ protected ValueTask ProcessInfoSqlResponseAsync(GenericResponse response
{
Debug.Assert(response.Data != null && response.Data.Length > 0);
- return ValueTask2.FromResult(response.Data);
+ return ValueTask.FromResult(response.Data);
}
#endregion
@@ -729,7 +729,7 @@ protected void ProcessFreeResponse(IResponse response)
{ }
protected ValueTask ProcessFreeResponseAsync(IResponse response, CancellationToken cancellationToken = default)
{
- return ValueTask2.CompletedTask;
+ return ValueTask.CompletedTask;
}
#endregion
@@ -758,7 +758,7 @@ protected ValueTask ProcessAllocateResponseAsync(GenericResponse response, Cance
_allRowsFetched = false;
State = StatementState.Allocated;
StatementType = DbStatementType.None;
- return ValueTask2.CompletedTask;
+ return ValueTask.CompletedTask;
}
#endregion
@@ -842,7 +842,7 @@ protected void ProcessExecuteResponse(GenericResponse response)
{ }
protected ValueTask ProcessExecuteResponseAsync(GenericResponse response, CancellationToken cancellationToken = default)
{
- return ValueTask2.CompletedTask;
+ return ValueTask.CompletedTask;
}
protected void ProcessStoredProcedureExecuteResponse(SqlResponse response)
@@ -1247,7 +1247,7 @@ protected void WriteRawParameter(IXdrWriter xdr, DbField field)
else
{
var svalue = field.DbValue.GetString();
- if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesEx().Count() > field.CharCount)
+ if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesToChars().Count() > field.CharCount)
{
throw IscException.ForErrorCodes(new[] { IscCodes.isc_arith_except, IscCodes.isc_string_truncation });
}
@@ -1272,7 +1272,7 @@ protected void WriteRawParameter(IXdrWriter xdr, DbField field)
else
{
var svalue = field.DbValue.GetString();
- if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesEx().Count() > field.CharCount)
+ if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesToChars().Count() > field.CharCount)
{
throw IscException.ForErrorCodes(new[] { IscCodes.isc_arith_except, IscCodes.isc_string_truncation });
}
@@ -1395,7 +1395,7 @@ protected async ValueTask WriteRawParameterAsync(IXdrWriter xdr, DbField field,
else
{
var svalue = await field.DbValue.GetStringAsync(cancellationToken).ConfigureAwait(false);
- if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesEx().Count() > field.CharCount)
+ if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesToChars().Count() > field.CharCount)
{
throw IscException.ForErrorCodes(new[] { IscCodes.isc_arith_except, IscCodes.isc_string_truncation });
}
@@ -1420,7 +1420,7 @@ protected async ValueTask WriteRawParameterAsync(IXdrWriter xdr, DbField field,
else
{
var svalue = await field.DbValue.GetStringAsync(cancellationToken).ConfigureAwait(false);
- if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesEx().Count() > field.CharCount)
+ if ((field.Length % field.Charset.BytesPerCharacter) == 0 && svalue.EnumerateRunesToChars().Count() > field.CharCount)
{
throw IscException.ForErrorCodes(new[] { IscCodes.isc_arith_except, IscCodes.isc_string_truncation });
}
@@ -1533,7 +1533,7 @@ protected object ReadRawValue(IXdrReader xdr, DbField field)
else
{
var s = xdr.ReadString(innerCharset, field.Length);
- var runes = s.EnumerateRunesEx().ToList();
+ var runes = s.EnumerateRunesToChars().ToList();
if ((field.Length % field.Charset.BytesPerCharacter) == 0 &&
runes.Count > field.CharCount)
{
@@ -1631,7 +1631,7 @@ protected async ValueTask