I have a C# Application.
I have a class that is generated from an xsd using xsd.exe. The class looks as follows
public class Transaction
{
public bool amountSpecified {get; set;}
public double amount {get; set;}
}
The following code shows an attempt at serialization
var transObj = new Transaction();
transObj.amount = 5.10;
var output =JsonConvert.Serialize(transObj);
The output string doesn't contain the amount field at all. It contains amountSpecified false which I don't want in my serialized json. However if I remove the amountSpecified field it works fine.
I have a huge set of classes and manually modifying each of them is a pain. My question is the following "Is there a way I can ignore all the fields with the PostFix "Specified" in Json.Net?" Or better still "Is it possible to generate c# class from xsd without the "Specified" postfix fields?"
I would be very glad if someone can point me in the right direction. Thanks in advance.