Open BinGuoGuo opened 6 years ago
Not currently, one workaround is if you make interface members explicit that'll omit the interface property
interface ITest
{
int TestProperty { get; }
}
class Test : ITest
{
//The property what I want not to serialize
int ITest.TestProperty => 0;
public int Other { get; set; } = 1;
}
Test t = new Test();
string result = LitJson.JsonMapper.ToJson(t);
will result in
{"Other":1}
This does seem related to what's requested in #80
Thank you for your reply,It's works!:)
I've contributed a ideal of it.See here https://github.com/LitJSON/litjson/pull/86
For example , class 'Test' implement interface 'ITest' ,as you know, class 'Test' must has some PUBLIC properties what defined in the interface.But I don't want to serialize the property,so what should I do? Below is the example-code:
I look forward to your reply :)