This project has moved. For the latest updates, please go here.


Dec 19, 2009 at 5:39 PM

Hi guys,


I'm using EntitySpaces as my ORM and it created classes with the [XmlIgnore] attribute for properties that shouldn't be serialized. This is an automatic process and I cannot change this attribute to [JsonIgnore]. Is it possible to configure to use [XmlIgnore] instead of [JsonIgnore] ?


Thank you all,


Eduardo Freitas

Dec 19, 2009 at 6:38 PM

Overriding this line inside the method CreateProperty from the DefaultContractResolver seems to do the trick:


bool hasIgnoreAttribute = (JsonTypeReflector.GetAttribute<JsonIgnoreAttribute>(member) != null);




bool hasIgnoreAttribute = (JsonTypeReflector.GetAttribute<JsonIgnoreAttribute>(member) != null) ||
          (JsonTypeReflector.GetAttribute<System.Xml.Serialization.XmlIgnoreAttribute>(member) != null);

Is there a better way to do it ?