diff --git a/src/ZCS.DataContractResolver/DataContractResolver.cs b/src/ZCS.DataContractResolver/DataContractResolver.cs index baf0917..838b175 100644 --- a/src/ZCS.DataContractResolver/DataContractResolver.cs +++ b/src/ZCS.DataContractResolver/DataContractResolver.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.Serialization; @@ -85,7 +85,7 @@ private static IEnumerable CreateDataMembers(JsonTypeInfo json propertyName = attr?.Name ?? fieldInfo.Name; propertyType = fieldInfo.FieldType; getValue = fieldInfo.GetValue; - setValue = (obj, value) => fieldInfo.SetValue(obj, value); + setValue = fieldInfo.SetValue; } else if (memberInfo.MemberType == MemberTypes.Property && memberInfo is PropertyInfo propertyInfo) @@ -98,7 +98,7 @@ private static IEnumerable CreateDataMembers(JsonTypeInfo json } if (propertyInfo.CanWrite) { - setValue = (obj, value) => propertyInfo.SetValue(obj, value); + setValue = propertyInfo.SetValue; } } else