Can required WCF4 DataMemeber's be organized into required groups?

Is there a way to have required DataMember's within a DataContract to be organized into groups so that you really only require group one or group two but no both to be provided?

I am looking to see if there is functionality similar to Workflow Activity validation where you can flag InArgument's with a RequiredArgument and then use OverloadGroup attribute to put these into groups so that only the arguments in one of the specified groups are required.

Answers


It is not possible out of the box with DataContractSerializer but you can switch to XmlSerializer and use xsd:choice (XmlChoiceIdentifierAttribute) but be aware that this will affect your data class beacuse this construct has its own requirements.


Nope, there is no way to do this. Only way to group is to have two different classes and extract away members/properties into those classes, but still...you won't be able to dictate an "either-on" setting.


Need Your Help

How can i get id of cascade deleted (or marked for delete) items in sqlalchemy?

python sql postgresql sqlalchemy cascading-deletes

When I cascade delete one item, I want get list of all deleted items id (primary key) including ids of deleted children. Is it possible?

Selecting values grouped to a specific identifer

mysql sql database

I have an application that tracks high scores in a game.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.