I have C# objects/entities (like person or customer) which contains the usual
amount properties/attributes like name, address and so on..
I would like to "tag" some of these properties, so that when I'm generating
and XML Schema (via Wsdl for instance) the tags are displayed in the Schema
portion of the Wsdl. Something like the following snippet:
<?xml version="1.0" encoding="utf-8"?>
<xs:scheme attributeFormDefault="unqualified"
elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:search="searchNS">
<xs:element name="Customer">
<xs:complexType>
<xs:sequence>
<xs:element name="FirstName" type="xs:string" search:able="Y"/>
<xs:element name="LastName" type="xs:string" search:able="Y"/>
<xs:element name="Address" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
-----------------------------------
As you see, I would like to "tag" the FirstName, LastName elements while
Address is not. I would like to accomplish this with something like this in
the class definition:
[XmlTag(Namespace="search", attributename="able" attributevalue="Y")]
public string FirstName {
get {
return this.firstNameField;
}
set {
this.firstNameField = value;
}
}
I'm grateful for any tips or pointers!