public IActionResult Details(int id) { var playerTeam = (from Player in _db.Players .Where(p => p.Id == id) join Team in _db.Teams on Player.TeamId equals Team.Id select new { Player.Id, Player.PlayerName, Player.PlayerImageUrl, Player.Birthplace, Player.DoB, Team.TeamName, Team.TeamBadgeUrl }) .FirstOrDefault(); var playerCountry = (from player in _db.Players .Where(p => p.Id == id) join Country in _db.Countries on player.CountryId equals Country.Id select new { Country.FlagUrl }).FirstOrDefault(); var playerPosition = (from player in _db.Players .Where(p => p.Id == id) join Position in _db.Positions on player.PositionId equals Position.PositionId select new { Position.Position }).FirstOrDefault(); var playerdet = new PlayerDetailModel(); playerdet.Id = playerTeam.Id; playerdet.PlayerName = playerTeam.PlayerName; playerdet.PlayerImageUrl = playerTeam.PlayerImageUrl; playerdet.DoB = playerTeam.DoB; playerdet.BirthPlace = playerTeam.Birthplace; playerdet.TeamName = playerTeam.TeamName; playerdet.TeamBadgeUrl = playerTeam.TeamBadgeUrl; playerdet.FlagUrl = playerCountry.FlagUrl; playerdet.Position = playerPosition.Position; return(View(playerdet)); }
private PlayerDetailModel GetDetailData(int Id) { var model = new PlayerDetailModel { Details = _detailPlayerQuery.Handle(new GetPlayerDetailsQuery() { ID = Id }) }; return(model); }
public IActionResult PlayerDetail(int id) { var player = _playerService.GetById(id); var model = new PlayerDetailModel() { PlayerId = player.Id, FirstName = player.FirstName, LastName = player.LastName, ImageUrl = player.ImageUrl }; return(View(model)); }
public IActionResult SearchTwitter(int id) { var player = _playerService.GetById(id); var model = new PlayerDetailModel() { PlayerId = player.Id, FirstName = player.FirstName, LastName = player.LastName, ImageUrl = player.ImageUrl }; model.RecentNews = new List <string> { "Twitter Info 1", "Twitter Info 2" }; return(View("PlayerDetail", model)); }