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

Commit f899fbd

Browse files
committed
Fix SL5 build
1 parent f2e127b commit f899fbd

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/ServiceStack.Text/TypeFields.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ public static SetMemberDelegate CreateSetter(this FieldInfo fieldInfo) =>
171171
public static SetMemberDelegate<T> CreateSetter<T>(this FieldInfo fieldInfo) =>
172172
PclExport.Instance.CreateSetter<T>(fieldInfo);
173173

174-
#if !SL5
175174
public static GetMemberDelegate GetReflection(FieldInfo fieldInfo) => fieldInfo.GetValue;
176175
public static SetMemberDelegate SetReflection(FieldInfo fieldInfo) => fieldInfo.SetValue;
177176

@@ -416,8 +415,6 @@ internal static DynamicMethod CreateDynamicSetMethod(MemberInfo memberInfo)
416415
? new DynamicMethod(name, returnType, DynamicSetMethodArgs, memberInfo.DeclaringType, true)
417416
: new DynamicMethod(name, returnType, DynamicSetMethodArgs, memberInfo.Module, true);
418417
}
419-
#endif
420-
421418
#endif
422419
}
423420
}

src/ServiceStack.Text/TypeProperties.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@ public static SetMemberDelegate<T> CreateSetter<T>(this PropertyInfo propertyInf
156156
#if !SL5
157157
public static GetMemberDelegate GetReflection(PropertyInfo propertyInfo) => propertyInfo.GetValue;
158158
public static SetMemberDelegate SetReflection(PropertyInfo propertyInfo) => propertyInfo.SetValue;
159+
#else
160+
public static GetMemberDelegate GetReflection(PropertyInfo propertyInfo) => o => propertyInfo.GetValue(o, null);
161+
public static SetMemberDelegate SetReflection(PropertyInfo propertyInfo) => (o,x) => propertyInfo.SetValue(o, x, null);
162+
#endif
159163

160164
public static GetMemberDelegate<T> GetExpression<T>(PropertyInfo propertyInfo)
161165
{
@@ -367,8 +371,6 @@ public static SetMemberDelegate SetEmit(PropertyInfo propertyInfo)
367371

368372
return (SetMemberDelegate)setter.CreateDelegate(typeof(SetMemberDelegate));
369373
}
370-
#endif
371-
372374
#endif
373375
}
374376
}

0 commit comments

Comments
 (0)