c# - How to set default value instead of null in deserialization -


after deserialization object null, cause exception in deserialization i've avoided problem setting appropriate property in class:

[jsonproperty("jerseynumber", nullvaluehandling = nullvaluehandling.ignore)] public int jerseynumber { get; set; } 

the problem after deserialization, value of int equal 0 because in json null.
want set null value empty, how can achieve this?
i've tryed with: [defaultvalue("null")] don't working because value integer.

set int nullable try following:

public int? jerseynumber { get; set; } 

Comments

Popular posts from this blog

android - questions about switching from C2DM to GCM -

rewrite asp to php based on asp query -

visual studio 2010 - Error on RDLC Expression -