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

Readme example: No response for GetSingleCategoryRecords #10

Open
MuxaJlbl4 opened this issue Jun 17, 2024 · 0 comments
Open

Readme example: No response for GetSingleCategoryRecords #10

MuxaJlbl4 opened this issue Jun 17, 2024 · 0 comments

Comments

@MuxaJlbl4
Copy link

MuxaJlbl4 commented Jun 17, 2024

Hello! Thanks for your wrapper implementation)
I'm trying to use example code from README.md, but can't get response with GetSingleCategoryRecords()
What am I doing wrong?

Visual Studio 2022
.Net Framework 4.8 Console App + SpeedrunDotComAPI from NuGet

using System;
using System.Linq;
using System.Threading.Tasks;
using SpeedrunDotComAPI;
using SpeedrunDotComAPI.Categories;
using SpeedrunDotComAPI.Leaderboards;
using SpeedrunDotComAPI.Runs;

namespace AsyncConsole
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Task task = Task.Run(async () => await PrintAsync());
            Console.ReadKey();
        }
        static async Task PrintAsync()
        {
            SRCApiClient src = new SRCApiClient();

            // Success request:
            CategoryModel[] sm64Categories = await src.Games.GetSingleGameCategories("sm64");
            CategoryModel seventyStar = sm64Categories.First(c => c.Name == "70 Star");
            Console.WriteLine(seventyStar.Rules.ToString());

            // No response:
            LeaderboardModel[] leaderboards = await src.Categories.GetSingleCategoryRecords(seventyStar.Id);
            RunPlaceModel worldRecord = leaderboards[0].Runs.First(r => r.Place == 1);
            Console.WriteLine(worldRecord.ToString());
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant