Пример #1
0
 public LeagueController(ILeagueRepository leagueRepository, ILeagueUserRepository leagueUserRepository, IUserScoreRepository userScoreRepository, ICacheService cacheService)
 {
     _leagueRepository     = leagueRepository;
     _leagueUserRepository = leagueUserRepository;
     _userScoreRepository  = userScoreRepository;
     _cacheService         = cacheService;
 }
Пример #2
0
        public FakeUserProfileRepository(IUserTeaserTeamRepository userTeaserTeamRepo,
            IRpxUserRepository rpxUserRepo, ILeagueRepository leagueRepo,
            ISiteUserRoleRepository siteUserRoleRepo)
        {
            _userTeaserTeamRepo = userTeaserTeamRepo;
            _rpxUserRepo = rpxUserRepo;
            _leagueRepo = leagueRepo;
            _siteUserRoleRepo = siteUserRoleRepo;

            //list.Add(new SiteUserRole(1, 1, 1));
            //list.Add(new SiteUserRole(2, 2, 2));

            //var users = siteUserRepo.Get();
            //var maxUserId = users.Max(x=>x.Id);
            //var minUserId = 5;
            //var roles = roleRepo.Get();
            //var maxRoleId = roles.Max(x=>x.Id);
            //var minRoleId = roles.Min(x=>x.Id);
            //for (int i = 11; i <= 20 ; i++)
            //{
            //    var userId = (i % (maxUserId+1 - minUserId)) + minUserId;
            //    var roleId = (i % (maxRoleId+1 - minRoleId)) + minRoleId;
            //    if (!this.list.Any(x => x.RoleId == roleId && x.SiteUserId == userId))
            //    {
            //        list.Add(new SiteUserRole(i, userId, roleId));
            //    }
            //}
        }
 /// <summary>
 ///     Constructor
 /// </summary>
 /// <returns></returns>
 public GenerateLeagueController(ILeagueRepository leagueRepository, ISeasonRepository seasonRepository, ITeamRepository teamRepository, ICountryRepository countryRepository)
 {
     this.leagueRepository  = leagueRepository;
     this.seasonRepository  = seasonRepository;
     this.teamRepository    = teamRepository;
     this.countryRepository = countryRepository;
 }
Пример #4
0
        public async Task ReturnLeagueWhichExistsInDbByGivenId()
        {
            // Arrange
            _leagueRepository = SoccerStatisticsContextMocker.GetInMemoryLeagueRepository("GetLeagueByIdReturnLeague");

            var expectedLeague = new League()
            {
                Id      = 1,
                Name    = "Primera Division",
                Country = "Spain",
                Season  = "2018/2019",
                MVP     = new Player()
                {
                    Id = 1, Name = "Lionel", Surname = "Messi"
                },
                Winner = new Team()
                {
                    Id = 1, ShortName = "FC Barcelona"
                }
            };

            League testLeague = null;

            // Act
            var err = await Record.ExceptionAsync(async
                                                      () => testLeague = await _leagueRepository.GetByIdAsync(1));

            // Assert
            err.Should().BeNull();

            testLeague.Should().NotBeNull();

            testLeague.Should().BeEquivalentTo(expectedLeague);
        }
Пример #5
0
 public LeaguesController(DataContext dataContext, ILeagueRepository leagueRepository, IMapper mapper, IUserRepository userRepository)
 {
     this.dataContext      = dataContext;
     this.leagueRepository = leagueRepository;
     this.mapper           = mapper;
     this.userRepository   = userRepository;
 }
 public ThePLeagueSupervisor(
     IApplicationUserRepository applicationUserRepository,
     IGearItemRepository gearItemRepository,
     IGearImageRepository gearImageRepository,
     IGearSizeRepository gearSizeRepository,
     ILeagueImageRepository leagueImageRepository,
     ITeamSignUpRepository teamSignUpRepository,
     IPreOrderRepository preOrderRepository,
     ILeagueRepository leagueRepository,
     ISessionScheduleRepository sessionScheduleRepository,
     ISportTypeRepository sportTypeRepository,
     ITeamRepository teamRepository
     )
 {
     this._applicationUserRepository = applicationUserRepository;
     this._gearItemRepository        = gearItemRepository;
     this._gearImageRepository       = gearImageRepository;
     this._gearSizeRepository        = gearSizeRepository;
     this._leagueImageRepository     = leagueImageRepository;
     this._teamSignUpRepository      = teamSignUpRepository;
     this._preOrderRepository        = preOrderRepository;
     this._leagueRepository          = leagueRepository;
     this._sessionScheduleRepository = sessionScheduleRepository;
     this._sportTypeRepository       = sportTypeRepository;
     this._teamRepository            = teamRepository;
 }
Пример #7
0
 public LeagueService(ILeagueRepository leagueRepository, IMapper mapper, IMatchService matchService, IMatchRepository matchRepository)
 {
     _matchRepository  = matchRepository;
     _matchService     = matchService;
     _leagueRepository = leagueRepository;
     _mapper           = mapper;
 }
 public PlayerService(IPlayerRepository playerRepository, ITeamRepository teamRepository, ILeagueRepository leagueRepository, IMapper mapper)
 {
     _playerRepository = playerRepository;
     _teamRepository   = teamRepository;
     _leagueRepository = leagueRepository;
     _mapper           = mapper;
 }
Пример #9
0
 public PermissionService(ILogger <PermissionService> logger, IUserRepository userRepo, ILeagueRepository leagueRepo, IGameRepository gameRepo)
 {
     _logger     = logger;
     _userRepo   = userRepo;
     _leagueRepo = leagueRepo;
     _gameRepo   = gameRepo;
 }
 public StatisticsController(IStatisticsRepository repository, ILeagueRepository leagueRepository, ITipRepository tipRepository)
 {
     this.repository       = repository;
     this.leagueRepository = leagueRepository;
     this.tipRepository    = tipRepository;
     viewModel             = new StatisticsViewModel();
 }
Пример #11
0
 public GetLeaguesQueryHandler(
     IPoeTradeClient poeTradeClient,
     ILeagueRepository leagueRepository)
 {
     this.poeTradeClient   = poeTradeClient;
     this.leagueRepository = leagueRepository;
 }
Пример #12
0
 public GrabberService(IGrabberProvider scheduleProvider, IScheduleRepository scheduleRepository, ILeagueRepository leagueRepository,
                       IDataVersionRepository dataVersionRepository)
 {
     _scheduleRepository    = scheduleRepository;
     _leagueRepository      = leagueRepository;
     _grabberProvider       = scheduleProvider;
     _dataVersionRepository = dataVersionRepository;
 }
Пример #13
0
 public LeagueService(IActionHandler handler, ILeagueRepository leagueRepository, LeagueDTOMapper leagueMapper, LeagueFactory leagueFactory, ITelemetryEventService telemetry)
     : base(handler)
 {
     _leagueRepository = leagueRepository;
     _leagueMapper     = leagueMapper;
     _leagueFactory    = leagueFactory;
     _telemetry        = telemetry;
 }
Пример #14
0
 public CascadingDeleteService(ILeagueRepository leagueRepository, ISeasonRepository seasonRepository, IMatchRepository matchRepository, IMatchdayRepository matchdayRepository, ITeamRepository teamRepository)
 {
     this.leagueRepository   = leagueRepository;
     this.seasonRepository   = seasonRepository;
     this.matchRepository    = matchRepository;
     this.matchdayRepository = matchdayRepository;
     this.teamRepository     = teamRepository;
 }
Пример #15
0
 public LeagueController(ILogger <LeagueController> logger, ILeagueRepository repository, IMapper mapper, IUnitOfWork unitOfWork)
 {
     _unitOfWork = unitOfWork;
     _mapper     = mapper;
     _logger     = logger;
     //_repoWrapper = repoWrapper;
     _repository = repository;
 }
Пример #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LeaguesController"/> class.
 /// </summary>
 /// <param name="leagueRepository">The repository by which league data will be accessed.</param>
 /// <param name="sharedRepository">The repository by which shared data resources will be accessed.</param>
 /// <param name="mapper">The AutoMapper object used for object-object mapping.</param>
 /// <param name="linkGenerator">The <see cref="LinkGenerator"/> object used to generate URLs.</param>
 public LeaguesController(ILeagueRepository leagueRepository, ISharedRepository sharedRepository,
                          IMapper mapper, LinkGenerator linkGenerator)
 {
     _leagueRepository = leagueRepository;
     _sharedRepository = sharedRepository;
     _mapper           = mapper;
     _linkGenerator    = linkGenerator;
 }
 public PlayerService(IPlayerRepository playerRepo,
                      ITeamRepository teamRepo,
                      ILeagueRepository leagueRepo)
 {
     _playerRepo = playerRepo;
     _teamRepo   = teamRepo;
     _leagueRepo = leagueRepo;
 }
 public MatchService(IMatchPlayerRepository matchPlayerRepository, IMatchRepository matchRepository, ILeagueRepository leagueRepository, ITeamRepository teamRepository, IMapper mapper, IStatisticRepository statisticRepository)
 {
     _matchPlayerRepository = matchPlayerRepository;
     _teamRepository        = teamRepository;
     _matchRepository       = matchRepository;
     _leagueRepository      = leagueRepository;
     _mapper = mapper;
     _statisticRepository = statisticRepository;
 }
Пример #19
0
 public StatisticService(IMatchPlayerRepository matchPlayerRepository, IPlayerRepository playerRepository, IMatchRepository matchRepository, ILeagueRepository leagueRepository, IMapper mapper, IStatisticRepository statisticRepository)
 {
     _matchPlayerRepository = matchPlayerRepository;
     _playerRepository      = playerRepository;
     _matchRepository       = matchRepository;
     _leagueRepository      = leagueRepository;
     _mapper = mapper;
     _statisticRepository = statisticRepository;
 }
Пример #20
0
 public GameDataService(IGameDataRepository gameDataRepository, ILeagueRepository leagueRepository, IScheduleGameRepository scheduleGameRepository, ICompetitionRepository competitionRepository, ICompetitionConfigRepository competitionConfigRepository, ITeamService teamServ, ICompetitionService compService)
 {
     gameDataRepo          = gameDataRepository;
     leagueRepo            = leagueRepository;
     scheduleGameRepo      = scheduleGameRepository;
     competitionRepo       = competitionRepository;
     competitionConfigRepo = competitionConfigRepository;
     teamService           = teamServ;
     competitionService    = compService;
 }
 public CompetitionRepository(ISeasonRepository seasonRepository,
     ILeagueRepository leagueRepository,
     ITeamLeagueRepository teamLeagueRepository,
     IFixtureRepository fixtureRepository)
 {
     this.seasonRepository     = seasonRepository;
     this.leagueRepository     = leagueRepository;
     this.teamLeagueRepository = teamLeagueRepository;
     this.fixtureRepository    = fixtureRepository;
 }
Пример #22
0
 public LeagueService(ILeagueCodeRepository leagueCodeRepository,
                      ILeagueRepository leagueRepository,
                      IPlayersRepository playersRepository,
                      IImportService importService)
 {
     _leagueCodeRepository = leagueCodeRepository;
     _leagueRepository     = leagueRepository;
     _playersRepository    = playersRepository;
     _importService        = importService;
 }
 public CompetitionRepository(ISeasonRepository seasonRepository,
                              ILeagueRepository leagueRepository,
                              ITeamLeagueRepository teamLeagueRepository,
                              IFixtureRepository fixtureRepository)
 {
     this.seasonRepository     = seasonRepository;
     this.leagueRepository     = leagueRepository;
     this.teamLeagueRepository = teamLeagueRepository;
     this.fixtureRepository    = fixtureRepository;
 }
Пример #24
0
 public LeaguesController(ILeagueRepository leagueRepository,
                          IMlbDraftRepository mlbDraftRepository,
                          IMapper mapper,
                          ILogger <LeaguesController> logger)
 {
     _leagueRepository   = leagueRepository;
     _mlbDraftRepository = mlbDraftRepository;
     _mapper             = mapper;
     _logger             = logger;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LeaguesController"/> class.
 /// </summary>
 /// <param name="leaguesIndexViewModel">
 /// The <see cref="ILeaguesIndexViewModel"/> that will provide ViewModel data to the Index view.
 /// </param>
 /// <param name="leaguesDetailsViewModel">
 /// The <see cref="ILeaguesDetailsViewModel"/> that will provide ViewModel data to the Details view.
 /// </param>
 /// <param name="leagueRepository">
 /// The <see cref="ILeagueRepository"/> by which league data will be accessed.
 /// </param>
 /// <param name="sharedRepository">
 /// The <see cref="ISharedRepository"/> by which shared data resources will be accessed.
 /// </param>
 public LeaguesController(
     ILeaguesIndexViewModel leaguesIndexViewModel,
     ILeaguesDetailsViewModel leaguesDetailsViewModel,
     ILeagueRepository leagueRepository,
     ISharedRepository sharedRepository)
 {
     _leaguesIndexViewModel   = leaguesIndexViewModel;
     _leaguesDetailsViewModel = leaguesDetailsViewModel;
     _leagueRepository        = leagueRepository;
     _sharedRepository        = sharedRepository;
 }
Пример #26
0
 public TelegramBotService(IConfiguration configuration, ITelegramBotClient telegramClient, IDataVersionRepository dataVersionRepository,
                           IUserRepository userRepository, ILeagueRepository leagueRepository, IScheduleRepository scheduleRepository, IMapper mapper)
 {
     _mapper                = mapper;
     _telegramClient        = telegramClient;
     _userRepository        = userRepository;
     _leagueRepository      = leagueRepository;
     _scheduleRepository    = scheduleRepository;
     _dataVersionRepository = dataVersionRepository;
     _webHook               = configuration["WebHook"];
     _telegramUrl           = "/api/telegram/update";
 }
 public AdminController(IHorseRepository horseRepository, 
     IRepository<LeagueRace> leagueRaceRepository,
     IRepository<RaceDetail> raceDetailRepository,
     ILeagueRepository leagueRepository,
     IRepository<UserLeague> userLeagueRepository)
 {
     this.horseRepository = horseRepository;
     this.leagueRaceRepository = leagueRaceRepository;
     this.raceDetailRepository = raceDetailRepository;
     this.leagueRepository = leagueRepository;
     this.userLeagueRepository = userLeagueRepository;
 }
 public AdministrationController(IAdministrationRepository administrationRepository, ILeagueRepository leagueRepository,
                                 IMatchRepository matchRepository, ITipRepository tipRepository, IPredictionRepository predictionRepository,
                                 IAccountRepository accountRepository, IBetRepository betRepository)
 {
     this.administrationRepository = administrationRepository;
     this.leagueRepository         = leagueRepository;
     this.matchRepository          = matchRepository;
     this.tipRepository            = tipRepository;
     this.predictionRepository     = predictionRepository;
     this.accountRepository        = accountRepository;
     this.betRepository            = betRepository;
     viewModel = new AdministrationViewModel();
 }
Пример #29
0
 public ViberBotService(IConfiguration configuration, IViberBotClient viberBotClient, IDataVersionRepository dataVersionRepository, IImageHelper imageHelper,
                        IUserRepository userRepository, ILeagueRepository leagueRepository, IScheduleRepository scheduleRepository, IMapper mapper)
 {
     _mapper                = mapper;
     _viberBotClient        = viberBotClient;
     _userRepository        = userRepository;
     _leagueRepository      = leagueRepository;
     _scheduleRepository    = scheduleRepository;
     _dataVersionRepository = dataVersionRepository;
     _imageHelper           = imageHelper;
     _webHook               = configuration["WebHook"];
     _viberUrl              = "/api/viber/update";
 }
Пример #30
0
 public TeamsController(ITeamRepository teamRepository,
                        ILeagueRepository leagueRepository,
                        IUserRepository userRepository,
                        IMlbDraftRepository mlbDraftRepository,
                        IMapper mapper,
                        ILogger <TeamsController> logger)
 {
     _teamRepository     = teamRepository;
     _leagueRepository   = leagueRepository;
     _userRepository     = userRepository;
     _mlbDraftRepository = mlbDraftRepository;
     _mapper             = mapper;
     _logger             = logger;
 }
Пример #31
0
 public CreateSeasonValidator(ILeagueRepository repo)
 {
     _repo = repo;
     RuleFor(x => x).MustAsync(async(cmd, tok) =>
     {
         var league = await _repo.GetAsync(cmd.LeagueId);
         if (league == null)
         {
             return(false);
         }
         return(true);
         //return league.Teams.UniqueNameAbbr(cmd);
     });
 }
        public GroupsController(IGroupRepository groupRepo, ITournamentTypeRepository typeRepository
                                , ILeagueRepository leagueRepo, ITeamRepository teamRepository, IMatchRepository matchRepository,
                                ApplicationDbContext context)
        {
            _groupRepo       = groupRepo;
            _typeRepository  = typeRepository;
            _leagueRepo      = leagueRepo;
            _teamRepository  = teamRepository;
            _matchRepository = matchRepository;
            _context         = context;

            _hub = NotificationHubClient
                   .CreateClientFromConnectionString("Endpoint=sb://psmhub.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=VRZxkd15WUJsWXWmkt0UySRsCg6K/9ZSytBIdsV7Grs=", "MainNotification");
        }
Пример #33
0
        public async Task ReturnNullWhenLeagueDoNotExistsInDbByGivenId()
        {
            // Arrange
            _leagueRepository = SoccerStatisticsContextMocker.GetInMemoryLeagueRepository("GetLeagueByIdReturnNull");

            League testLeague = null;

            // Act
            var err = await Record.ExceptionAsync(async
                                                      () => testLeague = await _leagueRepository.GetByIdAsync(0));

            // Assert
            err.Should().BeNull();
            testLeague.Should().BeNull();
        }
 public AccountMembershipService(MembershipProvider provider, 
     ILeagueRepository leagueRepository,
     IUserRepository userRepository)
 {
     _provider = provider ?? Membership.Provider;
     this.leagueRepository = leagueRepository;
     this.userRepository = userRepository;
 }
Пример #35
0
 public void Setup()
 {
     _repository = MockRepository.GenerateMock<ILeagueRepository>();
     _query = new GetLeagueDataQuery(_repository);
 }
Пример #36
0
 public LeagueController(ILeagueRepository leagues)
 {
     Leagues = leagues;
 }
Пример #37
0
 public LeagueManager(ILeagueRepository leagueRepository, IUserManager userManager)
 {
     _leagueRepository = leagueRepository;
     _userManager = userManager;
 }
Пример #38
0
 public TeamManagementService(ITeamRepository teamRepository, IPlayerRepository playerRepository, ILeagueRepository leagueRepository)
 {
     _teamRepository = teamRepository;
     _playerRepository = playerRepository;
     _leagueRepository = leagueRepository;
 }
Пример #39
0
 public GetLeagueDataQuery(ILeagueRepository repository)
 {
     _repository = repository;
 }
Пример #40
0
 public LeagueManager()
 {
     _playerRepo = new Factory().PlayerRepository();
     _teamrepo = new Factory().TeamRepository();
     _leaguerepo = new Factory().LeagueRepository();
 }
Пример #41
0
 public LeagueService(ILeagueRepository leagueRepository)
 {
     _leagueRepository = leagueRepository;
 }