Question

 public class Test
    {
        public string Name { get; set; }
        public bool IsActive {get;set;}
    }

It is serialized as {"Name":"Test1","IsActive":false}

But target serialization result is {"Name":"Test1","IsActive":0}

PS: I can use shorten Property Names via DataContract. But this is value side.

Was it helpful?

Solution

You can just specify the SerializeFn for bool, e.g:

JsConfig<bool>.SerializeFn = value => value ? "1" : "0";
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top