1

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?

Robbie Dee
  • 1,939
  • 16
  • 43

1 Answers1

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