C
C#3y ago
Pdawg

JSON Array to build a complex object isn't letting me create multiple different properties inside it

Hi! I'm having an issue serializing a JSON object to create a Microsoft Band WebTile. Here is my code, and then the issue I'm having
9 Replies
Pdawg
PdawgOP3y ago
Pdawg
PdawgOP3y ago
There's my code
Pdawg
PdawgOP3y ago
Pdawg
PdawgOP3y ago
And here are the two errors I'm experiencing
Pdawg
PdawgOP3y ago
This is line 100 (the line with CS0746)
Pdawg
PdawgOP3y ago
Here is the line 40 with CS0826
Pdawg
PdawgOP3y ago
Matt Warren
Matt Warren3y ago
Under the "pages" element, each new {} constructs a different type, since they have different members. You'll have to type the array that is assigned to pages as new object [] { ... }
Pdawg
PdawgOP3y ago
They're already set up like that. All the pages are in array (inside {...}) Actually, multiple pages don't need to be created. This is a VERY specific use case, and honestly, the multiple pages added wouldn't make sense anyway. Thanks for the help though :)
Want results from more Discord servers?
Add your server