We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c385b0 commit 781320cCopy full SHA for 781320c
1 file changed
src/MsgPack/Serialization/SerializationTarget.cs
@@ -167,8 +167,15 @@ internal static IEnumerable<SerializingMember> GetTargetMembers( Type type )
167
.FirstOrDefault();
168
var id = item.data.GetNamedArguments()
169
.Where( arg => arg.GetMemberName() == "Order" )
170
- .Select( arg => ( int? )arg.GetTypedValue().Value )
+ .Select( arg => ( int? ) arg.GetTypedValue().Value )
171
172
+#if SILVERLIGHT
173
+ if ( id == -1 )
174
+ {
175
+ // Shim for Silverlight returns -1 because GetNamedArguments() extension method cannot recognize whether the argument was actually specified or not.
176
+ id = null;
177
+ }
178
+#endif // SILVERLIGHT
179
180
return
181
new SerializingMember(
0 commit comments