public static TeamResource Create(Team team, TeamLinks teamLinks, bool fullResource) { var teamResource = new TeamResource(team.Id) { Name = team.Name, }; if (team.CurrentLeagueCompetition != null) { var leagueResource = new LeagueResource(team.CurrentLeagueCompetitionId) { Name = team.CurrentLeagueCompetition.Name, }; teamResource.League = leagueResource; teamResource.LeaguePosition = team.CurrentLeaguePosition; } if (fullResource) { var ratingResource = RatingFactory.Create(team.Rating); teamResource.Rating = ratingResource; var formationResource = FormationResourceFactory.Create(team.Formation); teamResource.Formation = formationResource; } return teamResource; }
public GameResource(SeasonResource thisSeason, TeamResource myTeam, GameLinks links) : base(links) { MyTeam = myTeam; ThisSeason = thisSeason; }