Skip to content

Commit

Permalink
Fix platform ifdef.
Browse files Browse the repository at this point in the history
Only .NET 4.5 is missing these APIs and needs them to be implemented as extension methods.
  • Loading branch information
bgrainger committed Aug 15, 2017
1 parent aa0a85f commit 2d3cbcc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MySqlConnector/Utility.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Globalization;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -149,7 +149,7 @@ public static ArraySegment<T> Slice<T>(this ArraySegment<T> arraySegment, int in
public static ArraySegment<T> Slice<T>(this ArraySegment<T> arraySegment, int index, int length) =>
new ArraySegment<T>(arraySegment.Array, arraySegment.Offset + index, length);

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

#if !NETSTANDARD1_3
#if NET45
public static bool TryGetBuffer(this MemoryStream memoryStream, out ArraySegment<byte> buffer)
{
try
Expand Down

0 comments on commit 2d3cbcc

Please sign in to comment.