Entity序列化XML问题。
public int Id{get;set;}
public string Name{get;set;}
public string Desc{get;set}
我显示从数据库取值存到实体类里,然后序列化 可以成功
可是如果实体类某些属性没有值的话,序列化后的XML就没有该属性
比如Name当前没有值:<Id>1</Id><Desc></Desc>
没有Name节点 这种情况怎么处理?
先在此谢过。
...全文
public int Id{get;set;}
public string Name{get;set;}
public string Desc{get;set}