0

The original object contains a property 'CountryOfOrigin' with a value of 'EG'. The string returned from Serialize(object) has the value 63.

  var Reply_Product = response1.GetProductResponse.Product;
   ReplySer=Newtonsoft.Json.JsonConvert.SerializeObject(Reply_Product);

enter image description here

Data as retrieved from a web service (Promostandards)

After Serialization

After Serialization:

I am not sure what I need to try. I do not have a class for the Service Object. Would creating one help?

Charlieface
  • 52,284
  • 6
  • 19
  • 43
  • Might you please [edit] your question to include your code as **text** rather than as a screenshot? On stack overflow images should not be used for textual content, see [*Discourage screenshots of code and/or errors*](https://meta.stackoverflow.com/a/307500) and [*Why not upload images of code on SO when asking a question*](https://meta.stackoverflow.com/a/285557) for why. For instructions on formatting see *[How do I format my code blocks?](https://meta.stackexchange.com/q/22186)*. A [mcve] showing what you have tried that did not work would maximize your chances of getting help. See [ask]. – dbc Aug 14 '22 at 15:33
  • But it you just want to serialize an `enum` as a string, see [this answer](https://stackoverflow.com/a/2870420/3744182) by [Omer Bokhari](https://stackoverflow.com/users/56829/omer-bokhari) to [JavaScriptSerializer - JSON serialization of enum as string](https://stackoverflow.com/q/2441290/3744182) as well as [How to tell Json.Net globally to apply the StringEnumConverter to all enums](https://stackoverflow.com/q/7427909/3744182). – dbc Aug 14 '22 at 15:39

0 Answers0