Example #1
0
        public async Task <IEnumerable <Bet> > GetAllActiveBets()
        {
            var bets = await _betRepository.GetAll();

            var activeBets = bets.Where(x => !x.HasEnded);

            return(activeBets);
        }
Example #2
0
        public void BetSqlRepository_GetAll_ShouldBeOk()
        {
            //Cenário e Ação
            IEnumerable <Bet> betList = _repository.GetAll();

            //Verificar
            betList.Should().HaveCount(1);
            betList.First().Id.Should().Be(_seedId);
        }
Example #3
0
        public async Task <List <BetViewModel> > GetAllBets()
        {
            var allBets = await _betRepository.GetAll();

            if (allBets == null || !allBets.Any())
            {
                return(new List <BetViewModel>());
            }

            var betViewModels = allBets.Select(AutoMapper.Mapper.Map <BetViewModel>);

            return(betViewModels.ToList());
        }
Example #4
0
 public IEnumerable<Bet> GetAll()
 {
     return _betRepository.GetAll();
 }
Example #5
0
 public List <Bet> Bets()
 {
     return(_betRepository.GetAll());
 }