mgholam / fastJSON

Smallest, fastest polymorphic JSON serializer
https://www.codeproject.com/Articles/159450/fastJSON-Smallest-Fastest-Polymorphic-JSON-Seriali
MIT License
479 stars 147 forks source link

KeyValuePair<string, object>> in net 3.5 #120

Closed selo-dev closed 3 years ago

selo-dev commented 3 years ago

Hello, I use fastJson in .Net 3.5 and am not allowed to switch to .net 4.0 (sql crl). I would like to use the KeyValuePaar Collections and they are only supported in .net 4.0. Why? Why such a restriction here?

private void WriteValue(object obj) { …

if NET4

        else if (_params.KVStyleStringDictionary == false &&
            obj is IEnumerable<KeyValuePair<string, object>>)

            WriteStringDictionary((IEnumerable<KeyValuePair<string, object>>)obj);

endif

… }

mgholam commented 3 years ago

Probably an oversight, you can remove the conditional flag.

selo-dev commented 3 years ago

Hello, yes it works. Would be nice if you made this change to your branch too.

Thanks and regards

mgholam commented 3 years ago

Will do, thanks!