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?
Asked
Active
Viewed 782 times
1 Answers
3
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.
Community
- 1
- 1
user3021830
- 2,784
- 2
- 22
- 43