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

Commit 0757bea

Browse files
committed
Remove all old NETFX_CORE / NETSTANDARD1_1
1 parent 1021440 commit 0757bea

File tree

8 files changed

+8
-458
lines changed

8 files changed

+8
-458
lines changed

src/ServiceStack.Text/Common/ParseUtils.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ internal static class ParseUtils
2121

2222
public static object NullValueType(Type type)
2323
{
24-
#if NETFX_CORE
25-
return type.GetTypeInfo().IsValueType ? Activator.CreateInstance(type) : null;
26-
#else
2724
return type.GetDefaultValue();
28-
#endif
2925
}
3026

3127
public static object ParseObject(string value)

src/ServiceStack.Text/Common/WriteType.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,8 @@ private static bool Init()
208208
&& JsConfig.HasSerializeFn.Contains(propertyType)
209209
&& !JsConfig.HasIncludeDefaultValue.Contains(propertyType);
210210
bool propertySuppressDefaultAttribute = false;
211-
#if (NETFX_CORE)
212-
var shouldSerialize = (Func<T, bool>)null;
213-
#else
211+
214212
var shouldSerialize = GetShouldSerializeMethod(fieldInfo);
215-
#endif
216213
if (isDataContract)
217214
{
218215
var dcsDataMember = fieldInfo.GetDataMember();

src/ServiceStack.Text/HashSet.cs

Lines changed: 0 additions & 90 deletions
This file was deleted.

src/ServiceStack.Text/HttpUtils.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,7 @@ public static class HttpHeaders
14371437

14381438
public static class HttpMethods
14391439
{
1440-
static readonly string[] allVerbs = new[] {
1440+
static readonly string[] allVerbs = {
14411441
"OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT", // RFC 2616
14421442
"PROPFIND", "PROPPATCH", "MKCOL", "COPY", "MOVE", "LOCK", "UNLOCK", // RFC 2518
14431443
"VERSION-CONTROL", "REPORT", "CHECKOUT", "CHECKIN", "UNCHECKOUT",
@@ -1452,14 +1452,8 @@ public static class HttpMethods
14521452

14531453
public static HashSet<string> AllVerbs = new HashSet<string>(allVerbs);
14541454

1455-
public static bool HasVerb(string httpVerb)
1456-
{
1457-
#if NETFX_CORE
1458-
return allVerbs.Any(p => p.Equals(httpVerb.ToUpper()));
1459-
#else
1460-
return AllVerbs.Contains(httpVerb.ToUpper());
1461-
#endif
1462-
}
1455+
public static bool Exists(string httpMethod) => AllVerbs.Contains(httpMethod.ToUpper());
1456+
public static bool HasVerb(string httpVerb) => Exists(httpVerb);
14631457

14641458
public const string Get = "GET";
14651459
public const string Put = "PUT";

src/ServiceStack.Text/Pcl.Dynamic.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
using ServiceStack.Text.Support;
1818
#endif
1919

20-
#if !(SL5 || __IOS__ || NETFX_CORE)
20+
#if !(__IOS__)
2121
using System.Reflection;
2222
using System.Reflection.Emit;
2323
#endif
@@ -193,7 +193,7 @@ internal static string Underscored(IEnumerable<char> pascalCase)
193193
}
194194
}
195195

196-
#if !(SL5 || __IOS__ || NETFX_CORE)
196+
#if !(__IOS__)
197197
public static class DynamicProxy
198198
{
199199
public static T GetInstanceFor<T>()

src/ServiceStack.Text/PclExport.Net40.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ public MacPclExport()
594594
}
595595
#endif
596596

597-
#if NET45 || NETFX_CORE
597+
#if NET45 || NETSTANDARD2_0
598598
public class Net45PclExport : Net40PclExport
599599
{
600600
public static new Net45PclExport Provider = new Net45PclExport();

src/ServiceStack.Text/PclExport.NetStandard.cs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -172,26 +172,7 @@ public override string MapAbsolutePath(string relativePath, string appendPartial
172172
return Path.GetFullPath(relativePath.Replace("~", hostDirectoryPath));
173173
}
174174
return relativePath;
175-
}
176-
177-
#elif NETSTANDARD1_1
178-
public string BinPath = null;
179-
180-
public override string MapAbsolutePath(string relativePath, string appendPartialPathModifier)
181-
{
182-
if (BinPath == null)
183-
{
184-
var codeBase = GetAssemblyCodeBase(typeof(PclExport).GetTypeInfo().Assembly);
185-
if (codeBase == null)
186-
throw new Exception("NetStandardPclExport.BinPath must be initialized");
187-
188-
BinPath = Path.GetDirectoryName(codeBase.Replace("file:///", ""));
189-
}
190-
191-
return relativePath.StartsWith("~")
192-
? relativePath.Replace("~", BinPath)
193-
: relativePath;
194-
}
175+
}
195176
#endif
196177
public static PclExport Configure()
197178
{

0 commit comments

Comments
 (0)