private GameBE GetEntity(GameEntity ge) { if (null == ge) { return(null); } var result = new GameBE { AwayTeam = GetEntity(ge.AwayTeam), AwayTeamScore = ge.away_team_score.HasValue ? ge.away_team_score.Value : -1, Date = ge.game_date, Detail = string.IsNullOrEmpty(ge.detail) ? string.Empty : ge.detail, HomeTeam = GetEntity(ge.HomeTeam), HomeTeamScore = ge.home_team_score.HasValue ? ge.home_team_score.Value : -1, ID = ge.id, isHome = ge.HomeTeam.slug.Equals("kennesaw_state") ? true : false, SeasonID = ge.game_season_id, Status = ge.game_status, Time = ge.game_time, Type = ge.game_type, Venue = ge.venue }; return(result); }
public GameModel(GameBE game) { ID = game.ID; SeasonID = game.SeasonID; Datetime = game.Datetime; Type = game.Type; Status = game.Status; Venue = game.Venue; Detail = game.Detail.Replace("<br>", "<br/>"); AwayTeamScore = game.AwayTeamScore; HomeTeamScore = game.HomeTeamScore; AwayTeam = new TeamModel(game.AwayTeam); HomeTeam = new TeamModel(game.HomeTeam); isHome = game.isHome; CollegeLaxID = game.CollegeLaxID; }
private GameEntity GetGameEntity(GameBE gbe) { var ge = new GameEntity { away_team_score = gbe.AwayTeamScore, away_team_slug = gbe.AwayTeamSlug.Trim(), game_datetime = gbe.Datetime, game_season_id = (short)gbe.SeasonID, game_status = gbe.Status.Trim(), game_type = gbe.Type.Trim(), home_team_score = gbe.HomeTeamScore, home_team_slug = gbe.HomeTeamSlug.Trim(), id = (short)gbe.ID, venue = gbe.Venue.Trim() }; return(ge); }