Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 7fcf102

Browse files
committed
Rename Net40PclExport to Net45PclExport
1 parent c0bcb0a commit 7fcf102

File tree

3 files changed

+13
-31
lines changed

3 files changed

+13
-31
lines changed

src/ServiceStack.Text/PclExport.Net40.cs

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.Globalization;
88
using System.IO;
99
using System.Linq;
10-
using System.Linq.Expressions;
1110
using System.Net;
1211
using System.Reflection;
1312
using System.Runtime.CompilerServices;
@@ -20,20 +19,15 @@
2019
using ServiceStack.Text;
2120
using ServiceStack.Text.Common;
2221
using ServiceStack.Text.Json;
23-
using ServiceStack.Text.Support;
24-
25-
#if !__IOS__ && !NETSTANDARD2_0
2622
using System.Reflection.Emit;
27-
using FastMember = ServiceStack.Text.FastMember;
28-
#endif
2923

3024
namespace ServiceStack
3125
{
32-
public class Net40PclExport : PclExport
26+
public class Net45PclExport : PclExport
3327
{
34-
public static Net40PclExport Provider = new Net40PclExport();
28+
public static Net45PclExport Provider = new Net45PclExport();
3529

36-
public Net40PclExport()
30+
public Net45PclExport()
3731
{
3832
this.DirSep = Path.DirectorySeparatorChar;
3933
this.AltDirSep = Path.DirectorySeparatorChar == '/' ? '\\' : '/';
@@ -43,7 +37,7 @@ public Net40PclExport()
4337
this.InvariantComparer = StringComparer.InvariantCulture;
4438
this.InvariantComparerIgnoreCase = StringComparer.InvariantCultureIgnoreCase;
4539

46-
this.PlatformName = Environment.OSVersion.Platform.ToString();
40+
this.PlatformName = Platforms.Net45;
4741
ReflectionOptimizer.Instance = EmitReflectionOptimizer.Provider;
4842
}
4943

@@ -160,6 +154,12 @@ public override void WriteLine(string format, params object[] args)
160154
Console.WriteLine(format, args);
161155
}
162156

157+
public override async Task WriteAndFlushAsync(Stream stream, byte[] bytes)
158+
{
159+
await stream.WriteAsync(bytes, 0, bytes.Length);
160+
await stream.FlushAsync();
161+
}
162+
163163
public override void AddCompression(WebRequest webReq)
164164
{
165165
var httpReq = (HttpWebRequest)webReq;
@@ -463,27 +463,6 @@ public override DataMemberAttribute GetWeakDataMember(FieldInfo pi)
463463
}
464464
}
465465

466-
public class Net45PclExport : Net40PclExport
467-
{
468-
public static new Net45PclExport Provider = new Net45PclExport();
469-
470-
public Net45PclExport()
471-
{
472-
PlatformName = "NET45 " + Environment.OSVersion.Platform.ToString();
473-
}
474-
475-
public new static void Configure()
476-
{
477-
Configure(Provider);
478-
}
479-
480-
public override async Task WriteAndFlushAsync(Stream stream, byte[] bytes)
481-
{
482-
await stream.WriteAsync(bytes, 0, bytes.Length);
483-
await stream.FlushAsync();
484-
}
485-
}
486-
487466
internal class SerializerUtils<TSerializer>
488467
where TSerializer : ITypeSerializer
489468
{

src/ServiceStack.Text/PclExport.NetCore.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class NetCorePclExport : NetStandardPclExport
1010
{
1111
public NetCorePclExport()
1212
{
13+
this.PlatformName = Platforms.NetCore;
1314
ReflectionOptimizer.Instance = EmitReflectionOptimizer.Provider;
1415
}
1516

src/ServiceStack.Text/PclExport.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public static class Platforms
2626
public const string IOS = "IOS";
2727
public const string Mac = "MAC";
2828
public const string NetStandard = "NETStandard";
29+
public const string NetCore = "NetCore";
30+
public const string Net45 = "Net45";
2931
}
3032

3133
public static PclExport Instance

0 commit comments

Comments
 (0)