I am writing a weather API to connect to the NOAA's XML METARS in C# NETMF. Before, this API was written in PHP, where I was able to use an associative array to return the weather parameters. For example, the return of the getWX()
function might have been
Array(
"temp_f" => "70.0",
"windchil" => "65.0",
"wind_dir" => "90"
);
I am trying to replicate that same functionality in my CSharp version, but I am not sure how to go about doing it. Since I am using NETMF, I cannot use a hashtable.
Should I use a struct instead?
In case anyone wants to see the code behind the original PHP API, it is here: http://www.chrisseto.com/wordpress/?p=17 I am trying to get the CSharp version to be as similar as possible.
Thanks!