Example #1
0
 public void Initialise(Entities.Competition competition, CompetitionStage stage, CompetitionEvent competitionEvent, CompetitionRound round,
                        IPlayerFixtureModel playerFixture)
 {
     this.Competition      = competition;
     this.CompetitionStage = stage;
     this.CompetitionEvent = competitionEvent;
     this.CompetitionRound = round;
     this.PlayerFixture    = playerFixture;
 }
Example #2
0
        public async Task <IPlayerResultEngine> GetEngine(IResultsEngineRequest request)
        {
            await this._competitionRepository.GetForUpdate(request.CompetitionID);

            Entities.Competition competition = await this._competitionRepository.GetWithStages(request.CompetitionID);

            CompetitionStage stage   = this.GetStage(competition, request.CompetitionStageLoadMode, request.CompetitionStageValue);
            PlayerFixture    fixture = await this._playerFixtureRepository.GetFull(request.FixtureID);

            IPlayerFixtureModel        playerFixtureModel = this._serviceProvider.GetService <IPlayerFixtureModel>();
            IPlayerResultEngineContext context            = this._serviceProvider.GetService <IPlayerResultEngineContext>();

            context.Initialise(competition, stage, fixture.CompetitionRound.CompetitionEvent, fixture.CompetitionRound, playerFixtureModel);

            var engine = this._serviceProvider.GetService <IPlayerResultEngine>();

            engine.SetContext(context);
            await playerFixtureModel.Initialise(fixture, context);

            return(engine);
        }