public static IQueryable <Tour> GetToursByTournamentId(this IPredictionsContext context, int tournamentId, IFetchStrategy <Tournament>[] fetchStrategies)
        {
            var appliedStrategies = fetchStrategies.Select(fs => fs.Apply()).ToArray();
            var tournaments       = context.Tournaments.IncludeMultiple <Tournament>(appliedStrategies);
            var tournament        = tournaments.TournamentById(tournamentId);

            return(tournament.NewTours.AsQueryable());
        }
        public static IQueryable <Tour> GetLastTournamentTours(this IPredictionsContext context, IFetchStrategy <Tournament>[] fetchStrategies)
        {
            var appliedStrategies = fetchStrategies.Select(fs => fs.Apply()).ToArray();
            var tournaments       = context.Tournaments.IncludeMultiple <Tournament>(appliedStrategies);
            var lastTournament    = tournaments.LastAdded();

            return(lastTournament.NewTours.AsQueryable());
        }
        public static IQueryable <Expert> GetExperts(this IPredictionsContext context, IFetchStrategy <Expert>[] fetchStrategies = null)
        {
            if (fetchStrategies == null)
            {
                return(context.Experts);
            }
            var appliedStrategies = fetchStrategies.Select(fs => fs.Apply()).ToArray();

            return(context.Experts.IncludeMultiple <Expert>(appliedStrategies));
        }
Beispiel #4
0
        //private readonly IMapper _mapper;

        public CurrentTournamentToursController(IPredictionsContext context, IMapper mapper)
        {
            _expertService     = new ExpertService(context);
            _tourService       = new TourService(context);
            _predictionService = new PredictionService(context);
            _matchService      = new MatchService(context, mapper);
            _teamService       = new TeamService(context);
            _tournamentService = new TournamentService(context);

            _context = context;

            // _mapper = mapper;

            _fileService = new FileService();
        }
Beispiel #5
0
 public PredictionService(IPredictionsContext context)
 {
     _context = context;
 }
 public ExpertService(IPredictionsContext context)
 {
     _context = context;
 }
 public HomeController(IPredictionsContext context)
 {
     _context = context;
 }
 public TournamentService(IPredictionsContext context)
 {
     _context = context;
 }
Beispiel #9
0
 public HeadToHeadService(IPredictionsContext context)
 {
     _context = context;
 }
Beispiel #10
0
 public MatchService(IPredictionsContext context, IMapper mapper = null)
 {
     _context = context;
     _mapper  = mapper;
 }
        public static IQueryable <Tour> GetTours(this IPredictionsContext context, IFetchStrategy <Tour>[] fetchStrategies)
        {
            var appliedStrategies = fetchStrategies.Select(fs => fs.Apply()).ToArray();

            return(context.Tours.IncludeMultiple <Tour>(appliedStrategies));
        }