Search code examples
c#jsonserializationservicestack-text

Does ServiceStack JsonSerializer support ISerializable


Can ServiceStack.Text.JsonSerializer to work with class that implements ISerializable instead of taking public properties?

Thank you


Solution

  • No ISerializable doesn't have any impact in ServiceStack.Text serializers which by default only serializes public properties but can be made to also serialize public fields with:

    JsConifg.IncludePublicFields = true;
    

    There are also a number of different ways to ignore fields you don't want serialized.