Jason Sobell

Results 41 comments of Jason Sobell

No, the exception is "Operation is not valid due to the current state of the object", and is not thrown in the main library but appears to be thrown by...

After a little experimenting I can see that `toJSON` expects a `JSValue` to be returned, which of course means duplicating objects and collections to make them able to be `stringify`d....

It appears the main issue is that external JSON serializers don't understand the JSValue objects, even when they have base data types. For instance, calling NewtonSoft's serializer with a variable...

Not really. This assumes users are happy to create and assign an unknown number of these for every .NET object they want to be able to convert to JSON. I...

Is there a problem with performing this within the JSON class? : ``` res = new StringBuilder(obj is Array ? "[" : "{"); string prevKey = null; if (!(obj.Value is...

We can't expect everyone to have a base class for every object they want to serialise to JSON. There is this option (not fully tested): ``` public class JSValueConverter :...

Hmm, that still has an issue with `Set`. I'm going to leave this to you for now. I can't grasp the combinations of `JSObject` and things like `Set` to work...

Yes, although it doesn't matter if it's a DTO or any other type of .NET object, the same problem exists. The fundamental problem is that javascript script engines like this...

As a reference object, here's the one we use for testing: ``` engine.DefineVariable("Info").Assign(JSValue.Marshal(new Info { FirstName = "Fred", LastName = "Boulder", Child= new Info { FirstName = "Pebbles", LastName =...

OK, but does this mean the developer has to add every framework object they may ever serialise to the JsonSerializerRegistry?