Closed tpluscode closed 8 years ago
This is how xsd.exe generates classes from schemas that have schema ChoiceElements. In order for it to perform the validation (i.e. ensure that only one of those 4 possible elements is present), it has to leave it as an open ended object. There will also be spots with object[] Items
and ItemsChoiceType1[] ItemsElementName
, where it can have a collection of ChoiceElements. The order matters in these scenarios of the elements in both arrays.
For Example, if you are trying to assign an Annuity, and a DisabilityHealth to the to /TXLifeRequest/OLifE/Holding/Policy element, then that is not following the schema.
If you want Life_Type in Item, just assign it to the object and it will work. Doesn't create the best Intellisense experience for the developer, but ensures a valid xml schema!
I wanted to add
<Life>
node underTXLifeRequest/OLifE/Holding/Policy
and I noticed that thePolicy_Type
doesn't have a Life property. Upon inspecting the type I found the annotations onItem1
propertyWhy isn't there a property for
DisabilityHealth
,Life
andPropertyandCasualty
?