Database Reference
In-Depth Information
The JS library we're
using has a challenge
when working with
C#, in that it uses $
symbols in the names
of variables in the
JSON definition, and
in C#, $ is reserved.
The JSON library
generator cleans this
up for us by replacing
$ with __invalid_
name__$ . For your
purposes, your end
product must have
these exactly the
same, so for now
you will replace that
invalid name with
a placeholder, and
immediately prior to
returning the JSON,
replace the place-
holder with $ .
FIguR e 9 -10 The JSON that is the data for the visualization
Paste the code that you got for the JSON class over the class (make sure to
leave the lines starting with USING at the top, as well as the line starting with
namespace, and the final brace that closes the namespace. The class contents
are contained within the braces following the name of the class). You will
need to make some amendments to make this code work correctly however.
Replace __invalid_name__$ with DOLLAR (you do a reverse replace later).
Spaces are also illegal, so do a replace for __invalid_name__GDP Per Capita
with GDP_Per_Capita .
You can see the class in Figure 9-12.
Search WWH ::




Custom Search