public LoLService(SummonerContract summonerContract, PerfilContract perfilContract, LigaContract ligaContract, LoLStatsContext context, Perfil perfil) { _perfil = perfil; _context = context; _summonerContract = summonerContract; _ligaContract = ligaContract; _perfilContract = perfilContract; }
private Perfil PrepararObj(PerfilContract entity) { _perfil.AccountId = entity.GetSummonerContract().AccountId; _perfil.Name = entity.GetSummonerContract().Name; _perfil.Tier = entity.GetLigaContract().Tier; _perfil.Rank = entity.GetLigaContract().Rank; _perfil.QueueType = entity.GetLigaContract().QueueType; _perfil.LeaguePoints = entity.GetLigaContract().LeaguePoints; _perfil.Wins = entity.GetLigaContract().Wins; _perfil.Losses = entity.GetLigaContract().Losses; _perfil.Regiao = entity.GetRegiao(); return(_perfil); }
public async Task <IActionResult> SearchLoLAsync(string Summoner, int Region) { PerfilContract Result = await _loLService.GetProfileAsync(Summoner, Region); if (Result.Equals(null)) { ViewBag.Erro = "Gênero inválido ou não encontrado"; } else { ViewBag.Erro = ""; } ViewBag.Perfil = Result; return(View("~/Views/Result/List.cshtml")); }