Hi, here is the strange behaviour :
if I declare an enum like this
namespace mynamepsace
{
public enum LockedstatusReason
{
NotLocked = 0,
ShiftStarted = 1,
AcceptanceExpired = 2
}
}
and i have
[assembly: ContractNamespace(“http://anothernamespace”. ClrNamespace = “mynamepsace”)]
the xsd for the enum is emitted in
http://schemas.datacontract.org/2004/07/anothernamespace
and the xml schema does contains the allowed enumerated values
<xs:simpleType name=“LockedstatusReason”>
xs:list
xs:simpleType
<xs:restriction base="xs:string">
<xs:enumeration value="NotLocked">
<xs:annotation>
<xs:appinfo>
<EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">0</EnumerationValue>
</xs:appinfo>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="ShiftStarted">
<xs:annotation>
<xs:appinfo>
<EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">1</EnumerationValue>
</xs:appinfo>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="AcceptanceExpired">
<xs:annotation>
<xs:appinfo>
<EnumerationValue xmlns="http://schemas.microsoft.com/2003/10/Serialization/">2</EnumerationValue>
</xs:appinfo>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:list>
</xs:simpleType>
.------
IF i add a datacontract attribute to the enum , it goes correctly to
http://anothernamespace
BUT it does not contain the enumerated values :
<xs:simpleType name="LockedstatusReason">
<xs:list>
<xs:simpleType>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:list>
</xs:simpleType>
how is that ?
thank you
enrico