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

Commit 85734cd

Browse files
committed
fix PCL build
1 parent 486a352 commit 85734cd

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/ServiceStack.Text/Reflection/StaticAccessors.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static Func<object, object> GetFastGetter(this Type type, string propName
3131
if (getterFnCache.TryGetValue(key, out fn))
3232
return fn;
3333

34-
fn = GetValueGetter(type.GetProperty(propName));
34+
fn = GetValueGetter(type.GetPropertyInfo(propName));
3535

3636
Dictionary<string, Func<object, object>> snapshot, newCache;
3737
do
@@ -54,7 +54,7 @@ public static Action<object, object> GetFastSetter(this Type type, string propNa
5454
if (setterFnCache.TryGetValue(key, out fn))
5555
return fn;
5656

57-
fn = GetValueSetter(type.GetProperty(propName));
57+
fn = GetValueSetter(type.GetPropertyInfo(propName));
5858

5959
Dictionary<string, Action<object, object>> snapshot, newCache;
6060
do

src/ServiceStack.Text/ReflectionExtensions.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,6 +1747,15 @@ public static bool IsGenericType(this Type type)
17471747
#endif
17481748
}
17491749

1750+
public static bool ContainsGenericParameters(this Type type)
1751+
{
1752+
#if (NETFX_CORE || PCL || NETSTANDARD1_1)
1753+
return type.GetTypeInfo().ContainsGenericParameters;
1754+
#else
1755+
return type.ContainsGenericParameters;
1756+
#endif
1757+
}
1758+
17501759
#if (NETFX_CORE)
17511760
public static object GetDefaultValue(this Type type)
17521761
{

0 commit comments

Comments
 (0)