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

Commit 159fb53

Browse files
committed
Handle static properties in default Pcl GetSetMethod impl
1 parent dbe1f83 commit 159fb53

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ServiceStack.Text/PclExport.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ public virtual SetPropertyDelegate GetSetMethod(PropertyInfo propertyInfo, Field
288288
if (propertyInfo.CanWrite)
289289
{
290290
var setMethodInfo = propertyInfo.SetMethod();
291+
if (setMethodInfo.IsStatic)
292+
return (instance, value) => setMethodInfo.Invoke(null, new[] { value });
293+
291294
return (instance, value) => setMethodInfo.Invoke(instance, new[] { value });
292295
}
293296
if (fieldInfo == null) return null;

0 commit comments

Comments
 (0)