Using with Service-Layer
- using with dependency injection feature
using RiotGamesApi.AspNetCore;
public class HomeController : Controller
{
public LolApi Api { get; set; }
public HomeController(LolApi _api)//Dependency Injection
{
Api = _api;
}
public async Task<IActionResult> Index()
{
var rit = await Api.NonStaticApi.ChampionMasteryv3
.GetChampionMasteriesBySummonerAsync(ServicePlatform.TR1, 466244);
return View(rit);
}
}
Updated almost 7 years ago