Пример #1
0
        private static Team MapTeam(MySqlDataReader dr)
        {
            var team = new Team
                {
                    Abbreviation = dr.GetString("abbreviation"),
                    City = dr.GetString("city"),
                    Conference = (Conference) dr.GetInt32("conferenceId"),
                    Id = dr.GetInt32("id"),
                    Name = dr.GetString("name")
                };

            Division division;
            Enum.TryParse(dr.GetString("division"), true, out division);
            team.Division = division;

            return team;
        }
Пример #2
0
        private IList<Team> CreateTeams()
        {
            var teams = new List<Team>();
            var team1 = new Team
                {
                    Id = HOME_TEAM_ID
                };
            var team2 = new Team
                {
                    Id = AWAY_TEAM_ID
                };

            teams.Add(team1);
            teams.Add(team2);

            return teams;
        }