public IHttpActionResult GetProgramAdditionForGame(string raceDayKey, BetTypeCode product) { RaceDayKey raceDay = RaceDayKey.FromString(raceDayKey); Service.RaceDay.Contracts.PoolService.ProgramChanges programAdditionForPool = _raceDayServiceGateway.GetProgramChangesForPool(raceDay, product); var programChanges = _mapper.Map <ProgramAddition>(programAdditionForPool); return(Ok(RestResult <ProgramAddition> .CreateSuccess(_betStatisticsPopulator.Populate(programChanges, raceDay, product)))); }
public IHttpActionResult GetDoubleOddsPaged(string raceDayKey, int page) { const int take = 25; int skip = (page - 1) * take; IList <DoubleOdds> doubleOdds = _raceDayServiceGateway.GetDoubleOdds(RaceDayKey.FromString(raceDayKey)) .OrderByDescending(x => x.Odds > 0) .ThenBy(x => x.Odds) .Skip(skip) .Take(take + 1) .ToList(); var viewmodel = new DoubleOddsPaged { HasMorePages = doubleOdds.Count == take + 1, DoubleOdds = _mapper.Map <IList <Models.DoubleOdds> >(doubleOdds.Take(take).ToList()) }; return(Ok(RestResult <DoubleOddsPaged> .CreateSuccess(viewmodel))); }
public IHttpActionResult GetTrotFormRowsForRace(string raceDayKey, int raceNumber) { Service.RaceDay.Contracts.PoolService.FormRows.TrotFormRowsForRace formsRows = _raceDayServiceGateway.GetTrotFormRowsForRace(RaceDayKey.FromString(raceDayKey), raceNumber); return(Ok(RestResult <TrotFormRowsForRace> .CreateSuccess(_mapper.Map <TrotFormRowsForRace>(formsRows)))); }
public IHttpActionResult GetScratchedStarts(string raceDayKey, BetTypeCode product) { IDictionary <int, int[]> scratchedStartsByRaceNumber = _raceDayServiceGateway.GetScratchedStartsForPool(RaceDayKey.FromString(raceDayKey), product); IList <ScratchedStart> scratchedStarts = scratchedStartsByRaceNumber.SelectMany(scratchesForRace => scratchesForRace.Value.Select(start => new ScratchedStart { RaceNumber = scratchesForRace.Key, StartNumber = start })).ToList(); return(Ok(RestResult <IList <ScratchedStart> > .CreateSuccess(scratchedStarts))); }
public IHttpActionResult GetProgramForGame(string raceDayKey, BetTypeCode product) { Service.RaceDay.Contracts.PoolService.Program program = _raceDayServiceGateway.GetProgramForPool(RaceDayKey.FromString(raceDayKey), product); return(Ok(RestResult <Models.Program> .CreateSuccess(_mapper.Map <Models.Program>(program)))); }
public IHttpActionResult GetActiveRaceDay(string raceDayKey) { Service.RaceDay.Contracts.PoolService.ActiveRaceDay activeRaceDay = _raceDayServiceGateway.FindActiveRaceDay(RaceDayKey.FromString(raceDayKey)); return(Ok(RestResult <ActiveRaceDay> .CreateSuccess(_mapper.Map <ActiveRaceDay>(activeRaceDay)))); }
public IHttpActionResult GetProductsForTimeline(string raceDayKey) { GamesForRaceDay gamesForRaceDay = _raceDayServiceGateway.GetGamesForRaceDay(RaceDayKey.FromString(raceDayKey)); return(Ok(RestResult <ProductsForTimeline> .CreateSuccess(_viewModelPopulator.Populate(gamesForRaceDay)))); }
public IHttpActionResult GetInvestmentForRaceDay(string raceDayKey) { var totalInvestmentsForRaceDay = _raceDayServiceGateway.GetTotalInvestmentsForRaceDay(RaceDayKey.FromString(raceDayKey)); return(Ok(RestResult <List <TotalInvestmentForPool> > .CreateSuccess(_mapper.Map <List <TotalInvestmentForPool> >(totalInvestmentsForRaceDay)))); }
public IHttpActionResult GetWeatherForRaceDay(string raceDayKey) { Service.RaceDay.Contracts.WeatherService.WeatherForRaceDay weather = _raceDayServiceGateway.GetWeatherForRaceDay(RaceDayKey.FromString(raceDayKey)); return(Ok(RestResult <WeatherForRaceDay> .CreateSuccess(_mapper.Map <WeatherForRaceDay>(weather)))); }