Exemplo n.º 1
0
        public ActionResult SetUpDB()
        {
            if (_testRepository.Any())
            {
                _testRepository.RemoveRange(_testRepository.AsQueryable());
            }
            //if (_derbyRepository.Any()) _derbyRepository.RemoveRange(_derbyRepository.AsQueryable());
            _unitOfWork.Save();
            if (_matcheRepository.Any())
            {
                _matcheRepository.RemoveRange(_matcheRepository.AsQueryable());
            }
            _unitOfWork.Save();
            if (_teamRepository.Any())
            {
                _teamRepository.RemoveRange(_teamRepository.AsQueryable());
            }
            if (_playerRepository.Any())
            {
                _playerRepository.RemoveRange(_playerRepository.AsQueryable());
            }
            if (_seasonRepository.Any())
            {
                _seasonRepository.RemoveRange(_seasonRepository.AsQueryable());
            }

            _unitOfWork.Save();


            var players = ditmer();

            //var players = itMinds();
            //var players = ElClásico();


            _seasonRepository.Add(new Season());
            _playerRepository.AddRange(players.ToList());
            _unitOfWork.Save();

            //itMindsMatch();


            return(RedirectToAction("CreateMatch", "MvcMatch"));
        }
Exemplo n.º 2
0
 public bool Any(Expression <Func <T, bool> > predicate) => _repository.Any(predicate);
 public bool Any(Expression <Func <T, bool> > predicate)
 {
     return(_repository.Any(predicate));
 }