I have a schema that goes something like this:
<xs:element name="account">
<xs:complexType>
<xs:sequeuence>
<xs:element name="accountid" type="xs:string"/>
<xs:element name="account" type="xs:string"/>
<xs:sequeuence>
</xs:complexType>
</xs:element>
When xsd generates a class for it, the end result is that the local
account element is named something like account1:
public partial class account
{
public string accountid { get; set; }
[System.Xml.Serialization.XmlElementAttribute("acco unt")]
public string account1 { get; set; }
}
In this case, the local account element represents the name of the
account and it is straight from the database column name. I would
rather not rename the element if possible. Is there a way to make it
not generate names like account1? There shouldn't be any issues with
either the schema nor the class with the property name being account.
So it seems like an internal issue of xsd tool (XmlCodeExporter
perhaps?)
If possible, I'd rather not massage it through SchemaImporterExtension,
etc. So if it can be achieved by a change in the schema - except for
renaming the element itself, that would be the best. Also this pattern
may repeat since in the database, there is no restriction that says the
table name and a column name cannot be identical. I am trying to find
a way to avoid this (account1) situation.
Thanks
Jiho