|
|
Comments and Discussions
|
|
 |

|
Hi Mehdi,
I run following test:
[Test]
public static void ObjectWithNullPropertyTest()
{
var ds = new MultiValue();
ds.keys = new List<object>(){1,2,3,4,5};
ds.values = new List<string>(){"1", "2", "3", "4", "5"};
ds.keySel = 3;
ds.refId = new Guid();
fastJSON.JSONParameters param = new JSONParameters();
param.SerializeNullValues = false;
param.UseExtensions = false;
param.UseFastGuid = false;
var newJson = fastJSON.JSON.Instance.ToJSON(ds, param);
Assert.AreEqual(newJson, "{\"values\":[\"1\",\"2\",\"3\",\"4\",\"5\"],\"keys\":[1,2,3,4,5],\"keySel\":3,\"refId\":\"00000000-0000-0000-0000-000000000000\"}");
}
with the following objects:
public class SingleValue
{
public SingleValue()
{
}
public SingleValue(string value, Guid refId)
{
this.value = value;
this.refId = refId;
}
public string value { get; set; }
public Guid refId { get; set; }
}
public class MultiValue : SingleValue
{
public MultiValue()
{}
public MultiValue(List<string> values, List<object> keys, object keySel, Guid refId)
{
this.values = values;
this.keys = keys;
this.keySel = keySel;
this.refId = refId;
}
public List<string> values { get; set; }
public List<object> keys { get; set; }
public object keySel { get; set; }
}
The problem is, that there's a comma to much after the '"keySel":3, ,' I was able to solve the problem by commenting out the following two lines in the JsonSerializer.cs
...
else
{
WritePair(p.Name, o);
if (o != null && _params.UseExtensions)
...
My question is now: why is the 'if' statement in there? I couldn't follow the logic of it or the comment (last non null).
Thanks for your help,
Chris
|
|
|
|

|
I will have to check it was probably for an edge case regarding the comma outputs.
Thanks Chris!
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Hi Mehdi,
were you able to look at the problem yet?
thanks,
Chris
|
|
|
|

|
Not yet but it is on my todo list, I have to create some unit test for the comma edge cases.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
This should be fixed in v2.0.12
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Hi Mehdi,
I try to write simple test and it fails.
Here's my test code:
sbyte zero = 0;
s = JSON.Instance.ToJSON(zero);
o = JSON.Instance.ToObject(s);
Assert.That(zero, Is.EqualTo(o));
parser throws exeption:
System.IndexOutOfRangeException was unhandled by user code
HResult=-2146233080
Message=Index was outside the bounds of the array.
Source=fastJSON
StackTrace:
at fastJSON.JsonParser.ParseNumber() in d:\tmp\fastJSON\fastJSON\JsonParser.cs:line 293
at fastJSON.JsonParser.ParseValue() in d:\tmp\fastJSON\fastJSON\JsonParser.cs:line 122
at fastJSON.JsonParser.Decode() in d:\tmp\fastJSON\fastJSON\JsonParser.cs:line 46
at fastJSON.JSON.ToObject(String json, Type type) in d:\tmp\fastJSON\fastJSON\JSON.cs:line 143
at fastJSON.JSON.ToObject(String json) in d:\tmp\fastJSON\fastJSON\JSON.cs:line 128
at fastJSON.Tests.Tests.Testsbyte() in d:\tmp\fastJSON\fastJSON.Tests\Tests.cs:line 144
InnerException:
thanks for your feedback,
Gintas
|
|
|
|

|
An edge case but you can fix it with :
...
if (index == json.Length)
break;
...
In jsonparser.cs ParseNumber() line 293.
Thanks.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
hi Mehdi,
i'm converting values with special characters (i.e. German Umlaut, etc.) from Objects to Json. The problem is now, that those values are converted to utf-8 escaped character (i.e. ü ==> \\u00FC).
I was wondering, why those characters are escaped and if there's a way around it, without converting it after the serialization.
thanks for your help,
Chris
|
|
|
|

|
The JSON standard states that all non-ASCII characters should be escaped like that.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
For some weird reason even what you say is true
i have the following situation...
var jsonText = "{\"some_number\": 108.541,\"date_time\": \"2011-04-13T15:34:09Z\", \"serial_number\": \"ασδασδα\",\"more_data\": {\"field1\": 1.0, \"field2\": \"hello\"}}";
var dict = (Dictionary<string,object>)fastJSON.JSON.Instance.Parse(json);
textbox1.Text = fastJSON.JSON.Instance.ToJSON(dict);
The textbox displays \u chars for the greek chars i put in serial_number.
The problem is that if i send that json object to a php Rest API the stored mysql string does not display greek but rather japanese at best. I happened to get json from that same rest api and my client displayed weird characters also (NOT ALWAYS though ??? i cannot seem to replicate, sometimes i see greek characters even though phpmyadmin displays Glyphs and sometimes i see Glyphs).
While using either System.Web.Script.Serialization.JavaScriptSerializer or Newtonsoft.Json
both the textbox and phpmyadmin display the greek characters properly.
I really hope you can fix this.
|
|
|
|

|
fastJSON does not have any problem deserializing the string you provided (with non ascii characters) and you should use ToObject() instead of Parse() if you want the object structure, Parse should be used when you don't know the structure or the container object beforehand.
Serialize is a different matter, currently fastJSON outputs in ascii format and all non ascii characters are escaped as \uxxxx (>32 and <128), the php side probably does not implement parsing \uxxxx chars.
Having said the above, I have contacted Master Crockford for clarification regarding UTF8/Unicode string defaults, I will post back when I get an answer.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
I am currently at work and i don't have access to my code.
I tested fastJSON Serialize and it produces the same result as what the server hands me over (that was previously serialized with Json.NET).
I am really at a loss.
Either the Streamwriter.Write(json) does something internally that i am not aware of and the php backend manages to parse it and send it to mysql as normal or i have no idea whatsoever what may be the case. Since the server sends me the same json result in fastJSON or json.net or system.web.
Since it happened at some point and the result was displayed not as intended using fastJSON i really cannot continue using it until the problem is resolved. You do realize that "some point" in computer science cannot be taken lightly (i.e. it was just one time and the likes...)
I am using fastJSON in most cases due to speed and mostly because of the code being that small.
|
|
|
|

|
I have created a JSONParameters.UseEscapedUnicode which will control the unicode output so this should work for you.
I will post this soon (testing at the moment )
Thanks.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Make sure you are using Encoding on your streams : http://msdn.microsoft.com/en-us/library/3aadshsx.aspx[^]
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Ok i seems to be working just fine in those 2 situations...
Either by using...
StreamWriter sw = new StreamWriter(request.GetRequestStream(),Encoding.ASCII);
sw.Write(json);
sw.Close();
with the default output.
or...
private static Regex DECODING_REGEX = new Regex(@"\\u(?<Value>[a-fA-F0-9]{4})", RegexOptions.Compiled);
private const string PLACEHOLDER = @"#!#";
public static string DecodeEscaped( string value )
{
return DECODING_REGEX.Replace(
value.Replace(@"\\", PLACEHOLDER),
m => {
return ((char)int.Parse(m.Groups["Value"].Value, NumberStyles.HexNumber)).ToString(); })
.Replace(PLACEHOLDER, @"\\");
}
public static string httpPost(string api,string json)
{
json = DecodeEscaped(json);
HttpWebRequest request =
(HttpWebRequest)WebRequest.Create(host+api);
request.Method = "POST";
request.ContentType = "application/json";
StreamWriter sw = new StreamWriter(request.GetRequestStream());
sw.Write(json);
sw.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader sr = new StreamReader(response.GetResponseStream());
string responseJson = sr.ReadToEnd();
sr.Close();
return responseJson;
}
relying on the default/autodetect encoding from the Streamwriter.
I will definitely stick with the first one that seems less error prone
I wasn't using Encoding at first.
modified 3 Dec '12 - 12:37.
|
|
|
|

|
I have fixed this issue in v2.0.11.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
|

|
Thanks!
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
|

|
When checking for the presence of attributes, you'll want to use IsDefined, rather than GetCustomAttributes.
MSDN[^]
It is about 4x times faster than using GetCustomAttributes.
|
|
|
|

|
Thanks Andrew!
Although fastJSON only does this once per type but still anything that goes faster is good
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
See below as well... a few more suggestions.
|
|
|
|

|
Take the following with a grain of salt, I'm looking over the code fairly quickly, so I might miss obvious things.
-SafeDictionary - Why have an internal class contain locks, especially on an instance level? I'd imagine that serializing/deserializing a string should not run into multi-threaded issues. Furthermore, you're breaking a standard expectation for .NET (static members are thread safe, while instance members are not). I think it would be safe enough to just use regular Dictionaries and rely on the user of your class to handle the locking properly. Otherwise, performance suffers for those not using in a multi-threaded way.
-Formatter.AppendIndent - Since you're just appending four spaces, you might want to use StringBuilder.Append(char, int) and just multiply count by 4. It'd likely be faster.
-JSON.ToObject - You have several calls to GetGenericTypeDefinition. You may want to cache that result off rather than calling it again and again.
-JSON.CreateMyProp - You may want to look at this[^]. You could do an initial test to see if the type is Nullable, get the underlying type and then reduce the number of checks that you have (ex. type.GetGenericArguments()[0]).
-myPropInfo - You spend time trying to find out what type something is. Why not instead of capturing that into a bool, capture a delegate to do something with it? It would reduce the amount of code you have and allow you to not pay the penalty of going over all the different types again. You could also use a factory pattern to create a concrete type (from an abstract base that defines the functionality) that handles it for the specific case. Either way would work.
|
|
|
|

|
I guess: SafeDictionary has locks because it is used by the JsonRegistry which is static. Therefore, multiple threads can access the dictionary at runtime. Since the dictionary is created and populated on demand (new type to parse etc), it should be thread-safe.
I have tried to replace SafeDictionary with the ConcurrentDictionary but this decreases portability a lot. In fact I believe that the JsonRegistry should not be static. Changing parameters can too easily lead to unexpected output:
1. Set IncludeReadOnly= false, serialize
2. Set IncludeReadOnly= true, serialize=> fails, since it uses the cache which was populated based on the previous definition (1).
Aron
|
|
|
|

|
Hi Andrew,
in my private version of FastJson I tried to implement your proposal in replacing the myPropInfo with a dictionary lookup. The outcome was devastating. The performance dropped about more than 200% in the given benchmark.
Interesting however is, that a combination if-else block (as-is) with a dictionary brings a significant bonus when exotic types are used.
You can check that version at: http://www.innotags.de/download/Apolyton.FastJSON.zip[^]
|
|
|
|

|
Interesting.
I wasn't recommending a dictionary for that portion, but rather to capture an action to perform instead of a set of multiple flags to determine what to do later.
|
|
|
|

|
If any one can make fastJSON faster I am all ears
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Hi Mehdi,
nice work! I run though into a problem, when I tried to deserialize a JSON into a polymporphic objects. My object model is similar to city => list<zoo> => list<animals>
Since I don't know what animals are within a zoo, I just have a type animal for each zoo. The problem is now, that only animals of type animal are created and not dogs, cats, etc.
Now, I would like to solve this problem through a custom type animal, in which I can check the supplied json for the necessary properties for each animal (dog barks, cat miaus, etc.)
The issue is now, that the current implementation (2.0.9) passes only a string to the custom deserializer and throws an error, if the custom type consist of multiple properties or additional object. I was now wondering if this could be changed to the passed parameter from string to a dictionary or full json object.
thanks for your feedback,
Chris
|
|
|
|

|
Thanks Chris!
"Custom Types" is intended for RECT, COLOR, ... etc. not for classes. fastJSON will automatically handle nested types for you if you have enabled the extensions (and given the dog inherits from animal).
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
hi Mehdi,
thanks for the quick response. The Problem is that those nested types defined as follow in JSON:
A point:
{ "geometry" :
{ "x" : 2781859.5718259001,
"y" : 5104563.3898882624
}
A polygon:
{ "geometry":
{ "rings":
[
[
[123.445, 23.456],
[33.123, 23.4345,
[33.125, 23.4345,
[123.2342, 23.4345]
],
[
[123.445, 23.456],
[33.123, 23.4345,
[33.125, 23.4345,
[123.2342, 23.4345]
]
]
}
}
(PS: I know, this is not best way to do this, but it was given to me as such and can not be changed )
I would need now to create a GeometryPoint and GeometryPolygon object, which belongs to a dataset which has a property Geometry (which can be point or polygon).
==> Dataset.Geometry could be of type GeometryPoint or GeometryPolygon (and both inherite from the base type Geometry)
I believe, that for this purpose I would need a custom type with needs to be able to parse the appropriate JSON substrings, yet those substrings need to be passes as Dictionary. Therefore my question regarding the passed type.
Unless, there's another approache to this problem?
thanks for your help,
Chris
|
|
|
|

|
Ah! the data does not have the $type extensions...
Try the Parse() method instead, it will give you a dictionary and list of object collections.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Hi Mehdi,
We are planning to use your work in our company. In that scope, I have done some major code review. For now, I can offer you two different packages, if you are interested: a small one and a big one.
The first is primarily focusing on the public API applies primarily minor code review changes. This should definitely a value to the community. Performance characterisics should not have been changed.
The second package is an intense review, in brief details:
- Harmonizing with .NET naming conventions
- Applying good principles like separation of concerns (with perf. in mind).
- Improving exception reporting
- Increasing flexibility of the framework: Property opt-in, Property opt-out. This should increase performance in real-life use cases.
- Small performance drop 1-3% (custo types always available)
- Unit test driven: all native serilization/ deserialization is tested (46+ Tests)
- 5+ Bug fixes
- Improved debugging capabilities
In the near future, I will have to make the basic funcionality again available under Silverlight 5. Which critical feature was removed by Microsoft?
Best Regards,
Aron
|
|
|
|

|
Thanks Aron!
Anything which doesn't break usage is most welcome (I would like to change somethings but it would break running code for people). Post your changes to me or you can fork the code for yourself and publish that way.
As for SL5, the code that doesn't exist is (in Reflection.cs):
...
DynamicMethod dynamicSet = new DynamicMethod("_", typeof(object), arguments, type, true);
...
I'm a bit put off by MS in this regard so I haven't put any time into creating a workaround for it.
[as a side note fastJSON works as is in MonoDroid, and I will publish soon ]
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Sorry Mehdi for the late response,
but I am quite busy during the week. For now, I don't want to post a public alternative. Therefore, I have uploaded the packages to a different server.
The first package was about code understanding and improving without changing or breaking stuff.
http://www.innotags.de/download/fastJSON.zip[^]
The second package is about bringing value to the code, improving and hardening it.
Performance:
===============================================
I have run additional performance tests on that package and I am not perfectly happy:
- I lost 10% during serialization. Maybe you could have a quick look, if there is an obvious mistake.
- Deserialization is equal, sometimes faster but not significally.
Abstract from the readme.txt
===============================================
The changes are basing on FastJSON 2.0.9
- All native non-exotic members are unit tested in serialization/ deserialization
- 'Json' class is tested with the complex class used for unit testing.
- NOT COVERED BY TESTS YET:
- JsonParameter interpretations
- $type support
- I had to change the namespace to something in order to be able to compare with FastJson 2.0.9
- The benchmark console app has also been adjusted slightly.
NEW FEATURES
===============================================
- Property Opt-in, Opt-out: See JsonParameter.SerializationPolicy. To be combined with DataMemberAttribute. I have choosen this attribute over Serializable attribute since the last is coming from System.Xml, DataMember from Runtime.Serialization. Performance hit first time the type is used.
- Added support DataMember.Name which allows to declaratively abstract the json field name from the property name which increases robustness of the resulting json protocol. It will also easy the case-insensitive implementation a lot I think. Performance hit first time the type is used.
- Added support for IgnoreDataMember. Useful for Opt-out scenarios. Performance hit first time the type is used.
- Added support for encoding, see JsonParameters.Encoding. Performance hit depending on the encoding used (no hit, if default encoding is used).
FIXED ISSUES
===============================================
- Benchmark: Using StopWatch instead of DateTime which is recommended to measure ellapsed time.
- JsonSerializer: DateTime to Utc is now respecting the kind of the datetime (JsonSerializer_DateTimeUtc)
- JsonSerializer: List of bytes was not properly serialized (see JsonSerializer_ByteEnumeration)
- JsonPropertyInfo.CanWrite (formerly named MyPropInfo) was always false for fields (should be always true).
- JsonPropertyInfo.Filled was never false. Returned by Reflection, which always sets it to true. Don't see the use of the variable. Removed.
- JsonPropertyInfo.GenericTypes was always null except for dictionaries with the name "Dictionary".
PENDING ISSUES
===============================================
- Benchmark mistake in BinaryFormatter: as you mention fastJSON based on streams is a lot slower. The BinaryFormatter consumes streams so it cannot directly be compared to FastJson. The use cases are different: in case of an http request for instance, the input value is 'stream' and not 'string'. In order to compare performance, the Json Benchmarks should also have the input value 'stream' and not string. The time to convert the input value have to be paid anyway -and it should be part of the FastJson Benchmark which is not the case.
- JsonDeserializer deserialization of byte[] is still failing, see Json_ByteEnumerationClass
- JsonRegistry is not threadsafe: changing ShowReadOnlyProperty has potential to corrupt running (de-)serializations. Should be removed. Unit tests reveal that the issue exists also in a single thread.
- There is a bug in the $type extension. It has a risk of return the wrong type. One can see it when exotic benchmark is run which will report an InvalidCastException.
Best Regards,
Aron
|
|
|
|

|
dynamic employee = new ExpandoObject();
employee.Name = "John Smith";
employee.Age = 33;
var manager = new ExpandoObject() as IDictionary<string, object>;
manager.Add("Name", "Allison Brown");
manager.Add("Age", 42);
Console.WriteLine(((string)fastJSON.JSON.Instance.ToJSON(employee)));
Console.WriteLine(fastJSON.JSON.Instance.ToJSON(manager));
Console.WriteLine(((string)ServiceStack.Text.JsonSerializer.SerializeToString(employee)));
Console.WriteLine(ServiceStack.Text.JsonSerializer.SerializeToString(manager));
Output:
{"$types":{"System.Dynamic.ExpandoObject, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089":"1"},"$type":"1"}
{"$types":{"System.Dynamic.ExpandoObject, System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089":"1"},"$type":"1"}
["[Name, John Smith]","[Age, 33]"]
{"Name":"Allison Brown","Age":42}
|
|
|
|

|
Thanks Alexandre!
I have had a couple of requests for "dynamic" support.
PRO's:
- a better coding experience
- you don't need to create the containing class (less coding)
CON's:
- requires .net4+
- a bit slow
Having said that I may add it as a better Parse() method for .net 4+ compilations.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
I have a anoying problem.
I am getting this error now. It has been working before in other projects but not in my recent.
This is a test code that is thowing the error:
Public Class fastJSONBuggTestC
Public Settings As New SettingsC
Public Class SettingsC
Public Version As Integer = 1
Public RegistrationKey As String = "unknown"
End Class
Public Sub New()
Dim testSettings As New SettingsC()
Dim param As New fastJSON.JSONParameters()
param.IgnoreCaseOnDeserialize = True
param.SerializeNullValues = True
param.UseExtensions = True
param.UseFastGuid = True
param.UseOptimizedDatasetSchema = True
param.UseUTCDateTime = True
param.UsingGlobalTypes = True
Dim jsonString As String = fastJSON.JSON.Instance.ToJSON(Settings, param)
Settings = fastJSON.JSON.Instance.ToObject(jsonString)
End Sub
End Class
It is this row:
Settings = fastJSON.JSON.Instance.ToObject(jsonString)
that is throwing the error "Cannot determine type", anyone now why this is hapening now and not before?
Thanks!
Robin Andersson
|
|
|
|

|
Can you send me the JSON string generated?
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Extremely through and highly optimized
|
|
|
|

|
A couple of examples:
One:
["foo0",{"foo1":"C:\\!bar1","foo2":"C:\\bar2"}]
[
"foo0",
{
"foo1" : "C:\\!bar1",
"foo2" : "C:\\bar2"}]
Two:
[{"foo":"'[0]"}]
[
{
"foo" : "'[
0
]"}]
|
|
|
|

|
Hi,
great work and I'd really appreciate it if you try to update the NuGet package regularly. So everyone can update to the latest version easyly.
Thanks a lot
|
|
|
|

|
I will try
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Thanks. 5-stars
|
|
|
|

|
like:
var arr2 = new[]{
new { Text = "M", Value = true},
new { Text = "F", Value = false }
};
var ttt = fastJSON.JSON.Instance.ToJSON(arr2, new fastJSON.JSONParameters() { UseExtensions = false });
the result is : "[{},{}]"
|
|
|
|

|
Actually it will serialize but *not* deserialize anonymous types, just set the EnableAnonymousTypes = true parameter.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Hello,
I run the console test and it appears that deserialization of dataset is not working.
Was it working in a previous version?
Tkanks a lot.
|
|
|
|

|
What error are you getting?
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
Thans for your answer.
The error is "Cannot determine type"
The code who provide error is:
ds = CreateDataset();
string text = fastJSON.JSON.Instance.ToJSON(ds);
DataSet ds2 = (DataSet)fastJSON.JSON.Instance.ToObject(text);
If the dataset is a property of an object, it's working.
But if the Dataset is the object it doens't work.
|
|
|
|

|
Root level deserialize of a dataset is not supported at the moment. The code will work fine if the dataset was in an object.
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|

|
I have added root level DataSet and DataTable support and will post shortly.
var ds = CreateDataset();
var s = fastJSON.JSON.Instance.ToJSON(ds);
var o = fastJSON.JSON.Instance.ToObject<DataSet>(s);
Its the man, not the machine - Chuck Yeager
If at first you don't succeed... get a better publicist
If the final destination is death, then we should enjoy every second of the journey.
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Smallest, fastest polymorphic JSON serializer (with Silverlight4 and MonoDroid support)
| Type | Article |
| Licence | CPOL |
| First Posted | 19 Feb 2011 |
| Views | 1,563,818 |
| Downloads | 25,985 |
| Bookmarked | 464 times |
|
|