adoma
❔ Why is my deserialize not working here:
private static void SearchGame() { Write("Title: "); string title = ReadLine(); HttpResponseMessage response = null; response = httpClient.GetAsync($"games/{title}").Result; response.EnsureSuccessStatusCode(); var content = response.Content.ReadAsStringAsync().Result; var games = JsonSerializer.Deserialize<List<GameDTO>>(content); foreach (var game in games) { WriteLine($"Id: {game.Id}"); WriteLine($"Title: {game.Title}"); WriteLine($"Description: {game.Description}"); WriteLine($"Release Date: {game.ReleaseDate}"); WriteLine($"Genre: {game.Genre}"); WriteLine($"Image URL: {game.ImageUrl}"); WriteLine(); } ReadKey(); Clear(); }
16 replies
✅ Asp.Net Help
I'm working on a assignment and really need some help.
We have to make a website where we can show high scores on 4 different games.
I have 2 tables (games and Scores) with a one to many relation between them, where one game can have many scores.
On the submit new high score page I have 4 input fields, the first one is a dropdown where I generated the game.titles from games table.
My problem is when I try to submit the gameId always stays on 0.
39 replies
I need help with the last part of an assignment
I´m a student from Sweden studying c# and i´m making a product manager.
The part i´m struggling with is removing a specific product from a list.
How the console program works, we have a menu option 1-6
option 1 Create product
option 2 display product
option 3 Create category
option 4 Place product in category
option 5 show category and products in it
I don´t have a problem with removing the product from the product dictionary. But the problem is that the product i removed still shows up when i choose option number 5. sorry if my explaining is bad, English is my second language.
I don´t have a problem with removing the product from the product dictionary. But the problem is that the product i removed still shows up when i choose option number 5. sorry if my explaining is bad, English is my second language.
12 replies