Reputation: 1977
I have a couple of service methods that take an object as a parameter. In the WCF Test Client, the object's properties are displayed in alphabetical order. It would be expedient if we could list certain properties together. Is there a way to do this with an attribute or such like?
Upvotes: 1
Views: 833
Reputation: 2924
You can use the DataMember
attribute with Order
parameter as:
[DataContract]
public class SomeAddress
{
[DataMember(Order=0)]
public string FirstName;
[DataMember(Order=1)]
public string LastName;
}
The original answer and more detail can be found here.
Upvotes: 3