Note that there are some explanatory texts on larger screens.

plurals
  1. POXSD: Using Visual studio xsd.exe not generating Array[] instead of List<>
    primarykey
    data
    text
    <p>Im using the xsd.exe tool to generate classes from a xsd file. The xsd file: </p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"&gt; &lt;xs:element name="BAXML"&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt;&lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element name="Limit" minOccurs="1" maxOccurs="10"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element name="LimitType"&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt;&lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:simpleType&gt; &lt;xs:restriction base="xs:string"&gt; &lt;xs:minLength value="3"/&gt; &lt;xs:maxLength value="10"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;/xs:element&gt; &lt;xs:element name="Amount"&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt;&lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:simpleType&gt; &lt;xs:restriction base="xs:int"&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;/xs:element&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; </code></pre> <p> </p> <p>The output is: </p> <pre><code>/// &lt;remarks/&gt; [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)] public partial class BAXML { private string counterpartyOrgNrField; private BAXMLLimit[] limitField; /// &lt;remarks/&gt; [System.Xml.Serialization.XmlElementAttribute("Limit")] public BAXMLLimit[] Limit { get { return this.limitField; } set { this.limitField = value; } }} /// &lt;remarks/&gt; [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.1")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class BAXMLLimit { private string limitTypeField; private int amountField; /// &lt;remarks/&gt; public string LimitType { get { return this.limitTypeField; } set { this.limitTypeField = value; }} /// &lt;remarks/&gt; public int Amount { get { return this.amountField; } set { this.amountField = value; } }} </code></pre> <p>Instead of:</p> <pre><code>private BAXMLLimit[] limitField; </code></pre> <p>I would like it to be </p> <pre><code>List&lt;BAXMLLimit&gt; limitField </code></pre> <p>Is there a way in the xsd todo this? Or some other way? Thx!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload