© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
15 replies
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();
> }
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Why is it not working
C#CC# / help
11mo ago
✅ Why is rng not working?
C#CC# / help
4y ago
Why ins't inlining working here?
C#CC# / help
17mo ago