Is there a way to have required DataMember’s within a DataContract to be organized into groups so that you really only require group one or group two but no both to be provided?
I am looking to see if there is functionality similar to Workflow Activity validation where you can flag InArgument’s with a RequiredArgument and then use OverloadGroup attribute to put these into groups so that only the arguments in one of the specified groups are required.
It is not possible out of the box with
DataContractSerializerbut you can switch toXmlSerializerand use xsd:choice (XmlChoiceIdentifierAttribute) but be aware that this will affect your data class beacuse this construct has its own requirements.