public UsersViewModel(Summoner summoner) { this.Id = summoner.SummonerId; this.Username = summoner.Username; this.LolUsername = summoner.LoLUsername; this.ServerName = summoner.Server1.Name; this.Server = summoner.Server1.ServerId; this.Score = summoner.Score; this.OverallScore = summoner.OverallScore; ranklistRepository rankRep = new ranklistRepository(); this.Rank = rankRep.GetRank(summoner); this.OverallRank = rankRep.GetOverallRank(summoner); this.DateRegistered = summoner.DateRegistered; this.Synced = summoner.Synced; this.LastActive = summoner.Logs.OrderBy(l => l.Date).Last().Date; this.last9Logs = from log in summoner.Logs.OrderByDescending(l => l.Date).Take(9) select new EventLogsViewModel(log); this.Games = summoner.SummonersGames.ToList(); }
public RanklistController() { this.rankRep = new ranklistRepository(); }