public static JToken SerializeObject(RootModel model)
        {
            RootSerializer serializer = new RootSerializer();
            var            token      = serializer.Serialize(model);

            return(token);
        }
        public static JToken UnbuildObject(object obj, bool implicitType = false)
        {
            RootSerializer serializer = new RootSerializer();
            RootAssembler  assembler  = new RootAssembler();
            var            model      = assembler.Disassemble(obj, !implicitType);

            return(serializer.Serialize(model));
        }
Beispiel #3
0
 /// <summary>
 /// Uses the <see cref="RootSerializer"/> to serialize a value.
 /// </summary>
 public IEnumerable <XObject> Serialize(string propertyName, object value)
 {
     return(RootSerializer.Serialize(propertyName, value, this));
 }