Hi I'm using the below class

Public List<string> name;
Public List<string> midname;

Once I serialize it I'm getting the following output like

 {"name":[hari],"midname":null}

But I want my answer to be like this

{"name":[hari]}

It shouldn't display the class attribute that has null value and I'm using c# .net framework.

If you are using Json.Net then You can try this by Decorating your property like this

[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public List<string> name { get; set; }

参考地址:http://stackoverflow.com/questions/15574506/how-to-remove-null-value-in-json-string

最新文章

  1. spring boot(三):Spring Boot中Redis的使用
  2. 【Linux管理】用户管理
  3. ionic cordova 热更新(引用自www.zyyapp.com/post/116.html)
  4. Webservice接口
  5. 【点滴积累,厚积薄发】windows schedule task的最小时间间隔是多少?
  6. php des 加密解密实例
  7. PHP文本框的值随下拉框改变
  8. java 代码的细节优化
  9. Altium Designer /DXP无网络铺铜:
  10. 第1章 游戏之乐——NIM(1)一排石子的游戏
  11. jquery GET POST
  12. C语言的本质(6)——位运算
  13. win32 字体变换与窗口同大同小
  14. PL/SQL 一个数据对象一个事务(rollback,submit)
  15. ImportError: No module named simplejson.scanner
  16. MVC使用记录
  17. HDU 4768 Flyer【二分】||【异或】
  18. Java实验报告一:Java开发环境的熟悉
  19. Linux定时任务计划
  20. Kubernetes 架构图

热门文章

  1. StackOverFlow排错翻译 - Python字符串替换: How do I replace everything between two strings without replacing the strings?
  2. JavaScript标准参考教材(alpha)--笔记
  3. 原创 C++之常量(二)
  4. 搭建高可用的rabbitmq集群 + Mirror Queue + 使用C#驱动连接
  5. Python中对时间日期的处理方法简单汇总
  6. favicon.ico 404
  7. 用批处理脚本一键安装 MongoDB
  8. CentOS(5.8/6.7)linux生产环境若干优化实战
  9. APUE 习题3-2 实现dup2,要求不使用fcntl函数。
  10. kmeans算法并行化的mpi程序