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

Commit 5b8e621

Browse files
committed
Can use expressions in netcore
1 parent e872552 commit 5b8e621

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

src/ServiceStack.Text/Reflection/StaticAccessors.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static Func<object, object> GetValueGetter(this PropertyInfo propertyInfo
2727

2828
public static Func<object, object> GetValueGetter(this PropertyInfo propertyInfo, Type type)
2929
{
30-
#if NETFX_CORE || NETSTANDARD1_1
30+
#if NETFX_CORE
3131
var getMethodInfo = propertyInfo.GetMethod;
3232
if (getMethodInfo == null) return null;
3333
return x => getMethodInfo.Invoke(x, TypeConstants.EmptyObjectArray);
@@ -47,7 +47,7 @@ public static Func<object, object> GetValueGetter(this PropertyInfo propertyInfo
4747

4848
public static Func<T, object> GetValueGetter<T>(this PropertyInfo propertyInfo)
4949
{
50-
#if NETFX_CORE || NETSTANDARD1_1
50+
#if NETFX_CORE
5151
var getMethodInfo = propertyInfo.GetMethod;
5252
if (getMethodInfo == null) return null;
5353
return x => getMethodInfo.Invoke(x, TypeConstants.EmptyObjectArray);
@@ -67,7 +67,7 @@ public static Func<T, object> GetValueGetter<T>(this PropertyInfo propertyInfo)
6767

6868
public static Func<T, object> GetValueGetter<T>(this FieldInfo fieldInfo)
6969
{
70-
#if (SL5 && !WP) || __IOS__ || XBOX || NETSTANDARD1_1
70+
#if (SL5 && !WP) || __IOS__ || XBOX
7171
return x => fieldInfo.GetValue(x);
7272
#else
7373

src/ServiceStack.Text/ReflectionExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,9 @@ public static EmptyCtorDelegate GetConstructorMethodToCache(Type type)
517517
if (emptyCtor != null)
518518
{
519519

520-
#if __IOS__ || XBOX || NETFX_CORE || NETSTANDARD1_1
520+
#if __IOS__ || XBOX || NETFX_CORE
521521
return () => Activator.CreateInstance(type);
522-
#elif WP || PCL
522+
#elif WP || PCL || NETSTANDARD1_1
523523
return System.Linq.Expressions.Expression.Lambda<EmptyCtorDelegate>(
524524
System.Linq.Expressions.Expression.New(type)).Compile();
525525
#else
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"frameworks": {
3+
"net45": {}
4+
},
5+
"runtimes": {
6+
"win": {}
7+
}
8+
}

src/ServiceStack.Text/project.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"System.Net.Requests": "4.0.11",
2929
"System.Dynamic.Runtime": "4.0.11",
3030
"Microsoft.CSharp": "4.0.1-*",
31-
"System.Reflection.Emit": "4.0.1"
31+
"System.Reflection.Emit": "4.0.1",
32+
"System.Linq.Expressions": "4.1.0"
3233
}
3334
},
3435
".NETPortable,Version=v4.5,Profile=Profile7": {

0 commit comments

Comments
 (0)