I have been using xsd.exe to generate a class for deserializing XML into. I have decimal value in the source xsd that is not required:
I've just noticed that it has actually included the following code:
private bool balanceFieldSpecified;
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool BalanceSpecified {
get {
return this.balanceFieldSpecified;
}
set {
this.balanceFieldSpecified = value;
}
}
Which provides the functionality I need.
I'll leave the question open for a while in case there is an elegant way to make use of nullable? type instead.