Exemplo n.º 1
0
 public PredictionsController(
     IPredictionsService predictionsService,
     UserManager <ApplicationUser> userManager)
 {
     this.predictionsService = predictionsService;
     this.userManager        = userManager;
 }
Exemplo n.º 2
0
 public MatchesController(ITeamsService ts, IMatchService ms, IMapper mapper, IPredictionsService ps)
 {
     this.ts     = ts;
     this.ms     = ms;
     this.mapper = mapper;
     this.ps     = ps;
 }
Exemplo n.º 3
0
 public PredictionsController(IGamblersService gamblers, IPredictionsService predictions, IGamesService games, IPlayersService players)
 {
     this.gamblers    = gamblers;
     this.predictions = predictions;
     this.games       = games;
     this.players     = players;
 }
Exemplo n.º 4
0
 public UsersController(IUsersService us, IMapper mapper, IPredictionsService ps, ITeamsService ts, UserManager <ApplicationUser> userManager)
 {
     this.us          = us;
     this.mapper      = mapper;
     this.ps          = ps;
     this.ts          = ts;
     this.userManager = userManager;
 }
Exemplo n.º 5
0
 public GamesController(ITeamsService teams, IGamesService games, IPlayersService players, IPredictionsService predictions, IGamblersService gamblers)
 {
     this.teams       = teams;
     this.games       = games;
     this.players     = players;
     this.predictions = predictions;
     this.gamblers    = gamblers;
 }
Exemplo n.º 6
0
 public UserController(
     UserManager <ApplicationUser> userManager,
     IPredictionsService predictionsService,
     IUsersService usersService)
 {
     this.userManager        = userManager;
     this.predictionsService = predictionsService;
     this.usersService       = usersService;
 }
Exemplo n.º 7
0
 public PredictionsController(ITeamsService ts, IMatchService ms, IPredictionsService ps, IMapper mapper,
                              UserManager <ApplicationUser> userManager)
 {
     this.ts          = ts;
     this.ms          = ms;
     this.ps          = ps;
     this.mapper      = mapper;
     this.userManager = userManager;
 }
Exemplo n.º 8
0
 public GraphDataService(
     IGraphDataQuery query,
     IPredictionsService predictionsService,
     ILogger <GraphDataService> logger
     )
 {
     _query = query;
     _predictionsService = predictionsService;
     _logger             = logger;
 }
Exemplo n.º 9
0
 public ManageDataController(IGamesService games,
                             IPredictionsService predictions,
                             IPlayersService players,
                             ITeamsService teams)
 {
     this.games       = games;
     this.predictions = predictions;
     this.players     = players;
     this.teams       = teams;
 }
Exemplo n.º 10
0
        public PredictionsServiceTest()
        {
            this.InitializeDbAndRepositories();

            this.predictionsService = new PredictionsService(
                this.predictionsRepository,
                this.fixtureRepository,
                this.followingRepository,
                this.usersRepository);

            this.SeedDatabase();
        }
Exemplo n.º 11
0
 public PredictionsController(
     UserManager <ApplicationUser> userManager,
     IPredictionsService predictionsService,
     ICountriesService countriesService,
     ILeaguesService leaguesService,
     IFixturesService fixturesService,
     IUsersService usersService)
 {
     this.predictionsService = predictionsService;
     this.countriesService   = countriesService;
     this.leaguesService     = leaguesService;
     this.fixturesService    = fixturesService;
     this.usersService       = usersService;
     this.userManager        = userManager;
 }
Exemplo n.º 12
0
 public BusPredictionsHandler(
     IDistributedCache cache,
     IRouteRepo routeRepo,
     IPredictionsService predictionsService,
     IBusPredictionRepo predictionRepo,
     IRouteMessageFormatter routeMessageFormatter,
     ILogger <BusPredictionsHandler> logger
     )
 {
     _cache                 = cache;
     _routeRepo             = routeRepo;
     _predictionsService    = predictionsService;
     _predictionRepo        = predictionRepo;
     _routeMessageFormatter = routeMessageFormatter;
     _logger                = logger;
 }
Exemplo n.º 13
0
 public MoviePredictionController(IPredictionsService predictionService, IRatingRepository ratingRepository)
 {
     _service          = predictionService;
     _ratingRepository = ratingRepository;
 }
Exemplo n.º 14
0
 public HomeController(IGamesService games, IGamblersService gamblers, IPredictionsService predictions)
 {
     this.games       = games;
     this.gamblers    = gamblers;
     this.predictions = predictions;
 }
Exemplo n.º 15
0
 public TeamsController(ITeamsService ts, IPredictionsService ps, IMapper mapper)
 {
     this.ts     = ts;
     this.ps     = ps;
     this.mapper = mapper;
 }
Exemplo n.º 16
0
        public static void CheckCorrectPredictions(UpdateFinishedGameViewModel model, IPredictionsService predictions, IGamblersService gamblers)
        {
            var realFinalResult = model.FinalResult.Split(new char[] { ':', '-' }).ToArray();
            var homeTeamGoals   = int.Parse(realFinalResult[0]);
            var guestTeamGoals  = int.Parse(realFinalResult[1]);

            var currentGamePredictions = predictions.GetAll().Where(p => p.GameId == model.Id).ToList();

            foreach (var prediction in currentGamePredictions)
            {
                currentPredictionPoints = 0;
                var finalResult              = prediction.FinalResult.Split(new char[] { ':', '-' }).ToArray();
                var homeTeamGoalsPrediction  = int.Parse(finalResult[0]);
                var guestTeamGoalsPrediction = int.Parse(finalResult[1]);
                var updatedPrediction        = new UpdatePredictionPointsViewModel();

                updatedPrediction.FinalResultPredicted = CheckIfResultIsCorrectlyPredicted(homeTeamGoals, guestTeamGoals, homeTeamGoalsPrediction, guestTeamGoalsPrediction);
                if (!updatedPrediction.FinalResultPredicted)
                {
                    updatedPrediction.SignPredicted = CheckIfSignIsCorrectlyPredicted(homeTeamGoals, guestTeamGoals, homeTeamGoalsPrediction, guestTeamGoalsPrediction);
                }
                else
                {
                    updatedPrediction.SignPredicted = true;
                }

                var goalscorerPredictionPoints = CheckCorrectGoalscorer(model, prediction.Goalscorer);
                currentPredictionPoints += goalscorerPredictionPoints;
                if (goalscorerPredictionPoints > 0)
                {
                    updatedPrediction.GoalscorerPredicted = true;
                }

                var currentPrediction = predictions.GetById(prediction.Id).FirstOrDefault();
                updatedPrediction.TotalPoints = currentPredictionPoints;
                var dataModel = AutoMapper.Mapper.Map <UpdatePredictionPointsViewModel, LesGamblers.Models.Prediction>(updatedPrediction);

                predictions.UpdatePrediction(dataModel, prediction.Id);
            }
        }
Exemplo n.º 17
0
 public MatchesController(IMatchesService matchesService, IPredictionsService predictionsService)
 {
     _matchesService = matchesService;
     _predictionsService = predictionsService;
 }
 public MatchesController(IMatchesService matchesService, IUsersService usersService, IPredictionsService predictionsService)
 {
     this.matchesService     = matchesService;
     this.usersService       = usersService;
     this.predictionsService = predictionsService;
 }