msx752 / RiotGamesAPI

[outdated] LeagueOfLegends API Library .NetCore
https://riotgamesapi.readme.io
MIT License
2 stars 1 forks source link

RiotGamesApiException: SelectedSubUrlCache is not found with this parameters #13

Closed Terminus-GS closed 6 years ago

Terminus-GS commented 6 years ago

Hi, I chose this API to create a small project using asp.net core mvc and using some of the stuff from your example site, all was okay. However, upon attempting to find a summoner, it throws RiotGamesApiException: SelectedSubUrlCache is not found with this parameters as an error, and using '.UseCache(false, false)' as shown in the example for non-static api calls, however it claims ' Error CS1061 'IBuild' does not contain a definition for 'UseCache' and no extension method 'UseCache' accepting a first argument of type 'IBuild' could be found'

Any advice? Code below.

 public async Task<IActionResult> Index()
        {
            var rit1 = new ApiCall()
                .SelectApi<SummonerDto>(LolApiName.Summoner)
                .For(LolApiMethodName.Summoners)
                .AddParameter(new ApiParameter(LolApiPath.BySummoner, (string)"mysummoner"))
                .UseCache(false, false)//<== optional
                .Build(ServicePlatform.EUW1)
                .Get();

Appologise if that structure is wrong, i couldnt find a lot about the summoner api in the documentation, or much else to be honest.

msx752 commented 6 years ago

there is no LolApiPath.BySummoner for this request, so it will be LolApiPath.ByName

also you can check here for more example : https://github.com/msx752/RiotGamesAPI/blob/master/RiotGamesApi.Tests/RiotGamesApis/SUMMONER_V3.cs


var rit = new ApiCall()
                .SelectApi<SummonerDto>(LolApiName.Summoner)
                .For(LolApiMethodName.Summoners)
                .AddParameter(new ApiParameter(LolApiPath.ByName, (string)"mysummoner"))
                .Build(Service_Platform)
                .Get();
Terminus-GS commented 6 years ago

Ah, Thank you! I looked more into your documentation when i was more awake and everything I needed was actually there.