public async Task <IActionResult> OnGetAsync(bool abort) { if (abort) { CurrentWeather = null; CurrentWeatherJson = ""; return(Page()); } if (!string.IsNullOrEmpty(CurrentWeatherJson)) { CurrentWeather = JsonSerializer.Deserialize <Measurement>(CurrentWeatherJson); await _db.AddMeasurementAsync(CurrentWeather); CurrentWeatherJson = ""; ViewData["SavedData"] = "Data tillaggd till databasen."; CityName = ""; } return(Page()); }