77using System . Globalization ;
88using System . IO ;
99using System . Linq ;
10- using System . Linq . Expressions ;
1110using System . Net ;
1211using System . Reflection ;
1312using System . Runtime . CompilerServices ;
2019using ServiceStack . Text ;
2120using ServiceStack . Text . Common ;
2221using ServiceStack . Text . Json ;
23- using ServiceStack . Text . Support ;
24-
25- #if ! __IOS__ && ! NETSTANDARD2_0
2622using System . Reflection . Emit ;
27- using FastMember = ServiceStack . Text . FastMember ;
28- #endif
2923
3024namespace 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 {
0 commit comments