tags:

views:

12

answers:

1

I have created a WCF REST service that returns JSON, but the properties in the objects that are serialized are returned alphabetically.

Is there any way I change this?

+1  A: 

Try setting the order property on your data members for your data contracts

  [DataContract]
  public class MyClass
  {
       [DataMember(IsRequired = true, Order = 1)]
       public int Id { get; set; }
  }

HTH,

Steve

Steve
That worked thanks :)
fr3dr1k8009