Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 59cfb1f

Browse files
Use Convert.ToHexString.
1 parent 9bc4e30 commit 59cfb1f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

‎src/FirebirdSql.Data.FirebirdClient.Tests/FbDataReaderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public async Task ReadBinaryTest()
313313
{
314314
bytes[i] = (byte)random.Next(byte.MinValue, byte.MaxValue);
315315
}
316-
var binaryString = $"x'{BitConverter.ToString(bytes).Replace("-",string.Empty)}'";
316+
var binaryString = $"x'{Convert.ToHexString(bytes)}'";
317317

318318
await using (var command = new FbCommand($"select {binaryString} from TEST", Connection, transaction))
319319
{

‎src/FirebirdSql.Data.FirebirdClient/Common/Extensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ public static IntPtr ReadIntPtr(this BinaryReader self)
4848

4949
public static string ToHexString(this byte[] b)
5050
{
51+
#if NET5_0_OR_GREATER
52+
return Convert.ToHexString(b);
53+
#else
5154
return BitConverter.ToString(b).Replace("-", string.Empty);
55+
#endif
5256
}
5357

5458
public static IEnumerable<IEnumerable<T>> Split<T>(this T[] array, int size)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /