tags:

views:

642

answers:

1

Does WCF support nullable enums? I have a DataMember that is a nullable enum type on the server-side however, when I generate a client-side proxy the type in the proxy is non-nullable.

+1  A: 

Is there a (propertyname)Specified property of type boolean?

public enum MyEnumType { EnumValue1, EnumValue2 }

public MyEnumType MyEnumValue;
public bool MyEnumValueSpecified;

Do you have a "MyEnumValueSpecified" of type bool in your WCF proxy?

WCF uses this to define whether or not a particular property has been specified or not.

That way, even if the property is of type "Enum....." it can be "nullable".

Marc

marc_s
No, the "Specified" property is not currently generated...