I suggest you ...

add JSON (de)serialization optimized for DataObjects.Net

Even though it is quite simple to serialize objects with the System.Web.Script.Serialization.JavaScriptSerializer it has some issues when there are circular references. There are ways to resolve this like using the [ScriptIgnore] tag or by avoiding properties who result in circular references with Linq (see also: http://stackoverflow.com/questions/2002940/json-and-circular-reference-exception). The DataObjects.Key is one of the properties that results in a circular reference which means it is harder to serialize in a straight forward manner. I'm not sure what the solution should be at the moment but maybe there are more developers who see this as a usefull feature and have ideas for the solution also.

10 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    JosJos shared this idea  ·   ·  Admin →

    3 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • JosJos commented  · 

        Never mind... with MVC 4 web api it is possible to return values with the dynamic type which allows you to return anonymous types so you can narrow down your results to the exact format you like.

      • JosJos commented  · 

        Actually, since we have DataObjects.Net and since we have jQuery, I prefer not to use ASP.Net controls anymore because a) the rich server-side development is very rich and for that we pay the price by performance. IMHO the main activity of a web-server these days should be providing (JSON) data being parsed clientside with something like jQuery or Mootools or whatever you prefer as a developer. Therefore, if DataObjects.Net would provide ways to provide a JSON facade, DataObjects would become an Ultimate (!) data provider for online applications. Maybe supporting the ODATA (http://www.odata.org/) would be an idea with this... just brain-farting a bit here! ;)

      • Dmitri MaximovAdminDmitri Maximov (Project manager, Xtensive LLC) commented  · 

        Jos,
        Thanks for reporting that. Are there any possibility to use Key.Format & Key.Parse methods for serializing/deserializing the value of a key?
        AFAIK, Newton JSON.NET provides the ability to invoke some custom serialization handlers by marking a method with [OnSerializing], etc. attributes

      Feedback and Knowledge Base