Exemplo n.º 1
0
 /// <summary>
 /// 根节点需要定义root
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="root"></param>
 /// <returns></returns>
 public static string Serialize(dynamic obj, string root)
 {
     return(XML.Serialize(obj, root, (int)System.Xml.Linq.SaveOptions.DisableFormatting));
 }
Exemplo n.º 2
0
 /// <summary>
 /// 已有xml根节点
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public static string Serialize(dynamic obj)
 {
     return(XML.Serialize(obj, null));
 }