Skip to content

Commit 2d3cbcc

Browse files
committed
Fix platform ifdef.
Only .NET 4.5 is missing these APIs and needs them to be implemented as extension methods.
1 parent aa0a85f commit 2d3cbcc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/MySqlConnector/Utility.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Globalization;
33
using System.IO;
44
using System.Linq;
@@ -149,7 +149,7 @@ public static ArraySegment<T> Slice<T>(this ArraySegment<T> arraySegment, int in
149149
public static ArraySegment<T> Slice<T>(this ArraySegment<T> arraySegment, int index, int length) =>
150150
new ArraySegment<T>(arraySegment.Array, arraySegment.Offset + index, length);
151151

152-
#if !NETSTANDARD1_3
152+
#if NET45
153153
public static Task<T> TaskFromException<T>(Exception exception)
154154
{
155155
var tcs = new TaskCompletionSource<T>();
@@ -167,7 +167,7 @@ public static byte[] TrimZeroByte(byte[] value)
167167
return value;
168168
}
169169

170-
#if !NETSTANDARD1_3
170+
#if NET45
171171
public static bool TryGetBuffer(this MemoryStream memoryStream, out ArraySegment<byte> buffer)
172172
{
173173
try

0 commit comments

Comments
 (0)