Exemple #1
0
        public IEnumerable <TableRowDTO> GetTable(string competitioName, CompetitionTableType tableType)
        {
            var           games   = gamesService.GetFinishedCompetitionGames(competitioName);
            ITableBuilder builder = TableBuilderFactory.CreateTableBuilder(tableType);

            return(builder.Build(games));
        }
Exemple #2
0
        public static ITableBuilder CreateTableBuilder(CompetitionTableType type)
        {
            switch (type)
            {
            case CompetitionTableType.Away: return(new AwayTableBuilder());

            case CompetitionTableType.Home: return(new HomeTableBuilder());

            case CompetitionTableType.General: return(new GeneralTableBuilder());
            }
            throw new ArgumentException("Invalid table type");
        }