public AppViewModel(LeaderBoardViewModelDTO leaderBoardDto, KillBoardViewModelDTO killboardBoardDto, GraveYardViewModelDTO graveYardViewModelDto, HelpersManager helpersManager) { APINavLinkUrls = new APINavLinkUrls(helpersManager); LeaderBoardViewModel = new LeaderBoardViewModel(leaderBoardDto); KillBoardViewModel = new KillBoardViewModel(killboardBoardDto); GraveyardViewModel = new GraveyardViewModel(graveYardViewModelDto); }
public LeaderBoardViewModel(LeaderBoardViewModelDTO leaderBoardDto) { Robots = leaderBoardDto.LeaderBoardRecord .Where(e => e.ActorType == "Robot") .OrderByDescending(e => e.CompletedErrandCount) .Take(5) .Select(e => new RobotViewModel(e)); Cyborgs = leaderBoardDto.LeaderBoardRecord .Where(e => e.ActorType == "Cyborg") .OrderByDescending(e => e.CompletedErrandCount) .Take(5) .Select(e => new CyborgViewModel(e)); }