开发者

How should this be done? (returing a collection of values)

开发者 https://www.devze.com 2023-01-02 18:47 出处:网络
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 arra开发者_如何学Cy to return the weather param

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 arra开发者_如何学Cy 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!

0

精彩评论

暂无评论...
验证码 换一张
取 消