Deserialize empty XML element as Guid.Empty

后端 未结 2 751
猫巷女王i
猫巷女王i 2021-01-18 19:47

I have some troubles with deserializing.


    ...
    
    ...

If I use

&l         


        
2条回答
  •  臣服心动
    2021-01-18 20:01

    Null is not the same as Guid.Empty. In the JSON serializer, you denote null using an empty string.

    If you serialize your class using XmlSerializer you'll see it uses xsi:nil="true" to denote a null value.

    For example:

    
      
    
    

提交回复
热议问题