jacobhood / Challonge-DotNet

MIT License
2 stars 4 forks source link

Allow calling the api directly with an object's id or url instead of the full object #6

Closed ErwanTLG closed 3 years ago

ErwanTLG commented 3 years ago

Let's say I have the tournament id or url stored in my database. The only way to do an api call on this tournament is to first get the tournament, then call the api, like this:

Tournament tournament = await challongeClient.GetTournamentByUrlAsync(tournamentUrl);
await challongeClient.StartTournamentAsync(tournament);

The idea is to add methods overloads which would allow the client to directly pass the url as the parameter for the api call, like this:

await challongeClient.StartTournamentAsync(tournamentUrl);

This would reduce the number of lines (improving code clarity), and reduces the number of api calls (improving performance).

jacobhood commented 3 years ago

This was originally the intended usage for such a scenario, but you're right, it's cumbersome and inefficient. Please proceed.