Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning null results #28

Open
AmadejKrepek opened this issue Jan 29, 2024 · 1 comment
Open

Returning null results #28

AmadejKrepek opened this issue Jan 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@AmadejKrepek
Copy link

AmadejKrepek commented Jan 29, 2024

I have ASP.NET CORE 6 WEB API.

image

Below is my code:

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);

}

@AmadejKrepek AmadejKrepek added the bug Something isn't working label Jan 29, 2024
@caizhiyuan
Copy link

the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants