public IActionResult Index([FromServices] IStandingsService standingsService)
        {
            var model = new StandingsModel(standingsService);

            model.CalculateStandings();
            return(View(model));
        }
        public StandingsQuery(IStandingsService service)
        {
            this.Service = service;

            Field <StandingsQuery>(
                name: "standings",
                arguments: new QueryArguments(new QueryArgument <IntGraphType> {
                Name = "id"
            }),
                resolve: context =>
            {
                var id = context.GetArgument <int>("id");
                return(this.Service.GetStandings(id));
            }
                );
        }
예제 #3
0
        public TeamRecordQuery(IStandingsService service)
        {
            this.Service = service;

            Field <TeamRecordType>(
                name: "teamrecord",
                arguments: new QueryArguments(new QueryArgument <StringGraphType> {
                Name = "name"
            }),
                resolve: context =>
            {
                var name = context.GetArgument <string>("name");
                return(this.Service.GetTeamRecord(name));
            }
                );

            Field <TeamRecordType>(
                name: "leader",
                arguments: null,
                resolve: context =>
            {
                return(this.Service.GetLeader());
            }
                );

            Field <StandingsType>(
                name: "standings",
                description: "Gets the standings for a certain StandingsId",
                arguments: new QueryArguments(
                    new QueryArgument <IntGraphType> {
                Name = "id"
            },
                    new QueryArgument <SortOrderType> {
                Name = "order", DefaultValue = SortOrder.Unspecified
            }),
                resolve: context =>
            {
                var id    = context.GetArgument <int>("id");
                var order = context.GetArgument("order", SortOrder.Unspecified);
                return(this.Service.GetStandings(id, order));
            }
                );
        }
        public TeamRecordMutation(IStandingsService service)
        {
            this.Service = service;

            Field <TeamType>(
                name: "createTeam",
                description: "Adds a new team to the league",
                arguments: new QueryArguments(
                    new QueryArgument <NonNullGraphType <TeamInputType> > {
                Name = "team"
            }
                    ),
                resolve: context =>
            {
                var team = context.GetArgument <Team>("team");
                return(this.Service.AddTeam(team));
            }
                );
        }
예제 #5
0
 public DataController(
     ApplicationDbContext db,
     ICountriesService countriesService,
     ISeasonsService seasonsService,
     ILeaguesService leaguesService,
     ITeamsService teamsService,
     IConfiguration configuration,
     IFixturesService fixturesService,
     IStandingsService standingsService,
     ITeamStatisticsService teamStatisticsService)
 {
     this.db = db;
     this.countriesService      = countriesService;
     this.seasonsService        = seasonsService;
     this.leaguesService        = leaguesService;
     this.teamsService          = teamsService;
     this.configuration         = configuration;
     this.fixturesService       = fixturesService;
     this.standingsService      = standingsService;
     this.teamStatisticsService = teamStatisticsService;
 }
예제 #6
0
 public StandingsController(IStandingsService standingsService, ILogger logger)
 {
     _standingsService = standingsService;
     _logger           = logger;
 }
 public StandingsController(IStandingsService standingsService)
 {
     _standingsService = standingsService;
 }
 public GraphQLController(IStandingsService service)
 {
     this.Service = service;
 }
예제 #9
0
 public TeamService(ITeamRepository teamRepository, IStandingsService standingsService, IGameRepository gameRepository)
 {
     _teamRepository   = teamRepository;
     _standingsService = standingsService;
     _gameRepository   = gameRepository;
 }
 public TeamsController(ITeamsService teamsService, IGamesService gamesService, IStandingsService standingsService)
 {
     _teamsService     = teamsService;
     _gamesService     = gamesService;
     _standingsService = standingsService;
 }
예제 #11
0
 public StandingsModel(IStandingsService service)
 {
     this.StandingsService = service;
 }
 public ResultService(FootballLeagueDbContext dbContext, IStandingsService standingsService) : base(dbContext)
 {
     _standingsService = standingsService;
 }
예제 #13
0
 public StandingsController(IStandingsService standingsService, ITeamsService teamsService)
 {
     this.standingsService = standingsService;
     this.teamsService     = teamsService;
 }
예제 #14
0
 public StandingsController(IStandingsService service, ILoggingService logger)
 {
     this.service = service;
     this.logger  = logger;
 }