I would like to have a serializer option to ignore empty collections. Right now I am using this:
I think this is something people can add themselves like you have do or with a JsonConverter.
By default Json.NET serializers through the IEnumerable interface, which makes it difficult to determine whether a collection is empty or not.
Yeah, that is why I am just checking for a Count property and using that if it exists. You have fast reflection code so this should be pretty cheap. I feel like this is a pretty core thing that would be nice to be included in the core serializer.
Most helpful comment
Yeah, that is why I am just checking for a Count property and using that if it exists. You have fast reflection code so this should be pretty cheap. I feel like this is a pretty core thing that would be nice to be included in the core serializer.