1
Vote

problem in searlization of nested object

description

I have a neasted object
public class PriceTestHierarchy {
    private MarketDataUncertaintyRule sourceIdUncertaintyRuleOne;
.......
}
public class MarketDataUncertaintyRule { private MarketDataUncertaintyRuleTestingType tested; ....}
public class MarketDataUncertaintyRuleTestingType { private string Name;....}

I serializeit like this ...
var serializer = new YAXLib.YAXSerializer(typeof(Dictionary<string, object>));
serializer.Serialize(object)

it comes like this ...
{
"SourceIdUncertaintyRuleOne" : {
        "_t" : "System.Collections.Generic.Dictionary`2[System.String,System.Object]",
        "_v" : {               
            "tested" : {
                "_t" : "Newtonsoft.Json.Linq.JObject, Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed",
                "_v" : {
                    "name" : {
                        "_t" : "JValue",
                        "_v" : []
                    }                       
                }
            },

comments

sina_iravanian wrote May 1, 2016 at 3:36 PM

How come the result is in JSon? YAXLib is an XML serialization library!

Please elaborate more. What do you expect from the result vs what do you get. What is your full class definitions? For example where is _t and _v defined?

prashant81delhi wrote May 3, 2016 at 9:28 AM

hi , that is the issue i have not defined _t , _v anywhere not sure where they are coming ... my class has only the vairabled that i gave you above