private async Task LoadDatas() { ThemeNombresModel model = new ThemeNombresModel(); model.date = date; model.nom = nom; model.prenom = prenom; var response = await AstrologieServiceHttp.GetNombres(model); switch (response.StatusCode) { case HttpStatusCode.OK: string content = await response.Content.ReadAsStringAsync(); //data = JsonConvert.DeserializeObject<ImportJson>(content); contentHtml = content; swLoaded = true; break; default: MatToaster.Add("Impossible de recevoir les données du serveur", MatToastType.Danger, "Erreur http " + response.StatusCode, "danger"); NavigationManager.NavigateTo("/"); break; } }
private async Task LoadDatas() { var response = await AstrologieServiceHttp.GetThemeAstral(model); switch (response.StatusCode) { case HttpStatusCode.OK: string content = await response.Content.ReadAsStringAsync(); this.data = JsonConvert.DeserializeObject <ImportJson>(content); this.swLoaded = true; this.swLock = true; break; default: this.MatToaster.Add("Impossible de recevoir les données du serveur", MatToastType.Danger, "Erreur http " + response.StatusCode, "danger"); this.NavigationManager.NavigateTo("/"); break; } }