🖥️How to use
How do you use it?
Using this library is very simple! Just use the ManagedWeatherMap namespace in any piece of code you want to use the library, as in: using ManagedWeatherMap;
Just use the Forecast class that contains:
GetWeatherInfo(long, string, UnitMeasurement)GetWeatherInfo(string, string, UnitMeasurement)ListAllCities()
The first three functions download the weather information for either the specified city ID or city name and return the relevant weather information, ForecastInfo, that contains these properties:
long CityIDstring CityNameWeatherCondition WeatherUnitMeasurement TemperatureMeasurement(see weather conditions)double Temperaturedouble FeelsLikedouble Pressuredouble Humiditydouble WindSpeeddouble WindDirection
where the UnitMeasurement is:
KelvinMeasurement for
TemperatureandFeelsLikeisK(Kelvin)Measurement for
WindSpeedism.s(Meters per second)Measurement for
PressureishPa(Hectopascal)
MetricMeasurement for
TemperatureandFeelsLikeisC(Celsius)Measurement for
WindSpeedism.s(Meters per second)Measurement for
PressureishPa(Hectopascal)
ImperialMeasurement for
TemperatureandFeelsLikeisF(Fahrenheit)Measurement for
WindSpeedismph(Miles per hour)Measurement for
PressureishPa(Hectopascal)
You're required to provide the API key for each weather operation, which you can get by visiting this page.
Asynchronous Operation
For web development and other cases where asynchronous development is appropriate, you can use the below functions which are declared to be asynchronous:
public static async Task<ForecastInfo> GetWeatherInfoAsync(long CityID, string APIKey, UnitMeasurement Unit = UnitMeasurement.Metric)
public static async Task<ForecastInfo> GetWeatherInfoAsync(string CityName, string APIKey, UnitMeasurement Unit = UnitMeasurement.Metric)
public static async Task<Dictionary<long, string>> ListAllCitiesAsync()Last updated