Create a JSON Object Containing a Named Array of Strings
Julio Bello
221
Reputation points
Hi, Everybody! Please see my class below...
[DataContract]
public class PutShipmentsReleaseRequest : BaseRequest
{
[DataMember(Name = "ShipmentIds")]
public string[] ShipmentIds { get; set; } // Mandatory, The tracking number or Unique Id of the shipment to defer
}
When it is serialized, it looks like this...
["3A02939620000008A1977","3A02939620000008A198D","3A02939620000008A199B","3A02939620000008A19A9"]
I need it to look like this...
{ "ShipmentIds": ["3A02939620000008A1977","3A02939620000008A198D","3A02939620000008A199B","3A02939620000008A19A9"] }
How can I achieve the desired output?