Beispiel #1
0
        // Constructor for design time
        //public SelectCompetitionViewModel()
        //{
        //    _dataService = SimpleIoc.Default.GetInstance<IFootballDataService>();
        //    _navigationService = null;
        //    GetAvailableCompetitionsCommand = new AsyncCommand<List<Competition>>(() => _dataService.GetAvailableCompetitionsAsync());
        //    GetAvailableCompetitionsCommand.Execute(null);
        //}


        public SelectCompetitionViewModel(IFootballDataService dataService, INavigationService navigationService)
        {
            _dataService       = dataService;
            _navigationService = navigationService;
            _dialogService     = null;
            GetAvailableCompetitionsCommand = new AsyncCommand <List <Competition> >(() => _dataService.GetAvailableCompetitionsAsync());
        }
 public LeaguesService(
     IUnitOfWork unitOfWork,
     IFootballDataService footballDataService,
     IBatchFactory batchFactory,
     IMapper mapper)
 {
     _unitOfWork          = unitOfWork;
     _footballDataService = footballDataService;
     _batchFactory        = batchFactory;
     _mapper = mapper;
 }
Beispiel #3
0
 // Contructor for DesignTime Only
 public CompetitionViewModel()
 {
     _competition = new Competition()
     {
         Id = 11, Name = "MyCompetition"
     };
     _dataService = SimpleIoc.Default.GetInstance <IFootballDataService>();
     GetCurrentStandingsCommand = new AsyncCommand <List <Team> >(() => _dataService.GetCurrentStandingsAsync(_competition.Id));
     GetTodayFixturesCommand    = new AsyncCommand <List <Match> >(() => _dataService.GetFixturesForDateAsync(_competition.Id, DateTime.Today));
     GetTodayFixturesCommand.Execute(null);
     GetCurrentStandingsCommand.Execute(null);
 }
Beispiel #4
0
        public CompetitionViewModel(Competition competition, IFootballDataService dataService)
        {
            _competition = competition;
            _dataService = dataService;

            GetCurrentStandingsCommand = new AsyncCommand <List <Team> >(() => _dataService.GetCurrentStandingsAsync(_competition.Id));
            GetTodayFixturesCommand    = new AsyncCommand <List <Match> >(() => _dataService.GetFixturesForDateAsync(_competition.Id, DateTime.Today));

            //if (IsInDesignMode)
            //{
            //    GetTodayFixturesCommand.Execute(null);
            //    GetCurrentStandingsCommand.Execute(null);
            //}
        }
Beispiel #5
0
 public CompetitionViewModelService(
     ILoggerFactory loggerFactory,
     IFootballDataService footballDataService,
     IAsyncRepository <CompetitionArea> areaRepository,
     IAsyncRepository <Competition> competitionRepository,
     IAsyncRepository <Team> teamRepository,
     IAsyncRepository <Standing> standingRepository,
     IAsyncRepository <TableItem> tableItemRepository)
 {
     _logger = loggerFactory.CreateLogger <CompetitionViewModelService>();
     _footballDataService   = footballDataService;
     _areaRepository        = areaRepository;
     _competitionRepository = competitionRepository;
     _standingRepository    = standingRepository;
     _teamRepository        = teamRepository;
     _tableItemRepository   = tableItemRepository;
 }
Beispiel #6
0
        public SelectCompetitionViewModel(IFootballDataService dataService, INavigationService navigationService, IDialogService dialogService)
        {
            _dataService       = dataService;
            _navigationService = navigationService;
            _dialogService     = dialogService;
            //_getAvailableCompetitionsCommand = new AsyncCommand<List<Competition>>(() => _dataService.GetAvailableCompetitionsAsync());
            //GetAvailableCompetitionsCommand.Execution.PropertyChanged += (s, e) =>
            //{
            //    if (e.PropertyName.Equals("IsFaulted"))
            //    {
            //        DisplayErrorMessage();
            //    }
            //};

            //if (IsInDesignMode)
            //{
            //    GetAvailableCompetitionsCommand.Execute(null);
            //}
        }
Beispiel #7
0
 public StandingsController(IFootballDataService footballDataService, IMapper mapper)
 {
     _footballDataService = footballDataService;
     _mapper = mapper;
 }
Beispiel #8
0
 public Application(IFootballDataService footballDataService, IFootballBetDataService footballBetDataService, IEnglishSoccerDataService englishSoccorDataService)
 {
     this.footballDataService      = footballDataService;
     this.footballBetDataService   = footballBetDataService;
     this.englishSoccorDataService = englishSoccorDataService;
 }
 public CompetitionController(IFootballDataService footballDataService, IMapper mapper, IMemoryCache memoryCache)
 {
     _footballDataService = footballDataService;
     _mapper = mapper;
     _cache  = memoryCache;
 }