Skip to content

Instantly share code, notes, and snippets.

@attilah
Created July 13, 2015 17:32
Show Gist options
  • Save attilah/2fa74ee35db0b52d6a1b to your computer and use it in GitHub Desktop.
Save attilah/2fa74ee35db0b52d6a1b to your computer and use it in GitHub Desktop.
Shopify Json construction before sending on the wire
I need to construct the following JSON in C#, it will be sent on the wire afterwards:
{
"custom_collection": {
"title": "IPods",
"collects": [
{
"product_id": 921728736
}
]
}
}
1. What is the most performant way to construct this?
2. How can one compose this with anonymous type construction? I had problem with the underscore separator within the key.
I'd like to avoid define all the "wrapper" classes with JsonProperty for the whole shopify API if possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment