You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public async Task<ActionResult> GetForecast()
{
_logger.LogInformation("Getting all Forecasts...");
OpenMeteoClient client = new OpenMeteoClient();
HourlyOptionsParameter[] parameters = new HourlyOptionsParameter[]
{
HourlyOptionsParameter.temperature_2m,
HourlyOptionsParameter.relativehumidity_2m,
};
Minutely15OptionsParameter[] parameters15Mins = new Minutely15OptionsParameter[]
{
Minutely15OptionsParameter.temperature_2m,
Minutely15OptionsParameter.relativehumidity_2m,
Minutely15OptionsParameter.precipitation,
Minutely15OptionsParameter.rain,
Minutely15OptionsParameter.weathercode,
Minutely15OptionsParameter.windspeed_10m,
Minutely15OptionsParameter.winddirection_10m,
Minutely15OptionsParameter.windgusts_10m,
};
WeatherModelOptionsParameter[] modelParameters = new WeatherModelOptionsParameter[]
{
WeatherModelOptionsParameter.icon_d2
};
// Set custom options
WeatherForecastOptions options = new WeatherForecastOptions();
options.Temperature_Unit = TemperatureUnitType.celsius;
options.Latitude = 45.70108f;
options.Longitude = 14.590678f;
options.Minutely15 = new Minutely15Options(parameters15Mins);
options.Models = new WeatherModelOptions(modelParameters);
// Make a new api call to get the current weather in tokyo
WeatherForecast weatherData = await client.QueryAsync(options);
return Ok(weatherData);
}
The text was updated successfully, but these errors were encountered:
I have ASP.NET CORE 6 WEB API.
Below is my code:
public async Task<ActionResult> GetForecast()
{
_logger.LogInformation("Getting all Forecasts...");
}
The text was updated successfully, but these errors were encountered: