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?
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?
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