Can JavaScriptSerializer exclude properties with null/default values?

前端 未结 7 1165
野趣味
野趣味 2020-12-01 05:08

I\'m using JavaScriptSerializer to serialize some entity objects.

The problem is, many of the public properties contain null or default values. Is there any way to m

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 05:53

    You can implement a JavaScriptConverter and register it using the RegisterConverters method of JavaScriptSerializer.

提交回复
热议问题