public async Task <IEnumerable <Bet> > GetAllActiveBets() { var bets = await _betRepository.GetAll(); var activeBets = bets.Where(x => !x.HasEnded); return(activeBets); }
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); }
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()); }
public IEnumerable<Bet> GetAll() { return _betRepository.GetAll(); }
public List <Bet> Bets() { return(_betRepository.GetAll()); }