private static List <DrawBasket> GetDrawBasketsForCup(int level, IClubService clubService) { var clubs = clubService.GetByLevel(level).ToList(); var cupClubsCount = clubs.Count / 10 * 4; var cupClubs = new List <Club>(); for (int i = 0; i < cupClubsCount; i++) { cupClubs.Add(clubs[i]); } var averageRatings = cupClubs.Select(p => new KeyValuePair <long, float>(p.Id, clubService.GetAverageSquadRating(p.Id))).ToList(); int[] potSizes = { cupClubsCount / 4, cupClubsCount / 4, cupClubsCount / 4, cupClubsCount / 4 }; var basketsForLeague = new List <DrawBasket>(); foreach (var ps in potSizes) { var ratings = averageRatings.GetRange(0, ps).ToList(); var keys = ratings.Select(ar => ar.Key).ToList(); var potClubs = cupClubs.Where(p => keys.Contains(p.Id)).ToList(); cupClubs.RemoveAll(p => keys.Contains(p.Id)); averageRatings.RemoveAll(ar => ratings.Contains(ar)); basketsForLeague.Add(new DrawBasket() { Clubs = potClubs.ToList() }); } return(basketsForLeague); }
public AttendanceController(IAttendanceService attendanceService, IActivityService activityService, IMemberService memberService, IClubService clubService) { AttendanceService = attendanceService; ActivityService = activityService; MemberService = memberService; ClubService = clubService; }
public TeamService(HemaneContext context, IUserService userService, IClubService clubService, IMatchService matchService) { _context = context; _userService = userService; _clubService = clubService; _matchService = matchService; }
public AdminController(IAdminService adminService, IAccountService accountService, IMemoryCache cache, ISportService sportService, IDisciplineService disciplineService, ICompetitionService competitionService, IEventService eventService, IHeatService heatService, IClubService clubService, ICourseService courseService, IDeviceService deviceService, IServiceProvider serviceProvider, ICategoryService categoryService, IChipService chipService, UserManager <ApplicationUser> userManager) { _adminService = adminService; _cache = cache; _accountService = accountService; _sportService = sportService; _disciplineService = disciplineService; _competitionService = competitionService; _eventService = eventService; _heatService = heatService; _clubService = clubService; _courseService = courseService; _deviceService = deviceService; _serviceProvider = serviceProvider; _categoryService = categoryService; _chipService = chipService; _userManager = userManager; }
public ClubViewModelService( AppDbContext dbcontext, IClubService clubService) { _dbcontext = dbcontext; _clubservice = clubService; }
public UserController(IUserService userService, IStudentService studentService, IClubService clubservice, ISponsorService sponsorService) { _userservice = userService; _studentservice = studentService; _clubservice = clubservice; _sponsorservice = sponsorService; }
public ClubController(IMapper mapper, ILog4Net logger, IClubService clubService, IDropDownService dropDownService) { _mapper = mapper; _logger = logger; _clubService = clubService; _dropDownService = dropDownService; }
private static List <DrawBasket> GetDrawBasketsForLeague(int level, IClubService clubService) { var clubs = clubService.GetByLevel(level).ToList(); var averageRatings = clubs.Select(p => new KeyValuePair <long, float>(p.Id, clubService.GetAverageSquadRating(p.Id))).ToList(); averageRatings = new List <KeyValuePair <long, float> >(averageRatings.OrderByDescending(ar => ar.Value)); int basket1Size = clubs.Count / 10 * 3; int basket2Size = clubs.Count / 10 * 3; int basket3Size = clubs.Count / 10 * 4; int[] potSizes = { basket1Size, basket2Size, basket3Size }; var basketsForLeague = new List <DrawBasket>(); foreach (var ps in potSizes) { var ratings = averageRatings.GetRange(0, ps).ToList(); var keys = ratings.Select(ar => ar.Key).ToList(); var potClubs = clubs.Where(p => keys.Contains(p.Id)).ToList(); clubs.RemoveAll(p => keys.Contains(p.Id)); averageRatings.RemoveAll(ar => ratings.Contains(ar)); basketsForLeague.Add(new DrawBasket() { Clubs = potClubs.ToList() }); } return(basketsForLeague); }
public ProfileService(TennisConnectDbContext context, IUserService userService, IClubService clubService, IAddressService addressService) { _context = context; _userService = userService; _clubService = clubService; _addressService = addressService; }
public ClubServiceTests() { _repoWrapper = new Mock <IRepositoryWrapper>(); _mapper = new Mock <IMapper>(); _blob = new Mock <IClubBlobStorageRepository>(); _clubService = new ClubService(_repoWrapper.Object, _mapper.Object, _blob.Object); }
public ClubMembersService(IRepositoryWrapper repoWrapper, IMapper mapper, IClubService clubService, IUserManagerService userManagerService) { _repoWrapper = repoWrapper; _mapper = mapper; _clubService = clubService; _userManagerService = userManagerService; }
public ClubsController(/*PingDbContext context,*/ IClubService service, IOrganismeService organismeService, IChampionnatService championnatService, QueryService queryService /*, CacheService cache*/) : base(/*context*/) { Service = service; OrganismeService = organismeService; ChampionnatService = championnatService; QueryService = queryService; // CacheService = cache; }
public HomeController( IFootballerService footballerService, IPositionService positionService, IClubService clubService) { this.footballerService = footballerService; this.positionService = positionService; this.clubService = clubService; }
public DataSeeder(FFDbContext _ctx) { playerSvc = new PlayerService(_ctx); clubSvc = new ClubService(_ctx); teamSvc = new TeamService(_ctx); userSvc = new UserService(_ctx); teamPlayerSvc = new TeamPlayerService(_ctx); playerSvc.Initialize(); }
public DataSeeder() { playerSvc = new PlayerService(FFDbContextFactory.CreateCtx()); clubSvc = new ClubService(FFDbContextFactory.CreateCtx()); teamSvc = new TeamService(FFDbContextFactory.CreateCtx()); userSvc = new UserService(FFDbContextFactory.CreateCtx()); teamPlayerSvc = new TeamPlayerService(FFDbContextFactory.CreateCtx()); playerSvc.Initialize(); }
public ManageItemsDetailsController( IUserService userService, ICityService cityService, IClubService clubService) { this.userService = userService; this.cityService = cityService; this.clubService = clubService; }
public ClubController( IClubService clubService, ICountryService countryService, IStadiumService stadiumService) { this.clubService = clubService; this.countryService = countryService; this.stadiumService = stadiumService; }
public EventController(IMapper mapper, ILog4Net logger, IEventService eventService, IClubService clubService, IMatchService matchService, IDropDownService dropDownService) { _mapper = mapper; _logger = logger; _eventService = eventService; _matchService = matchService; _clubService = clubService; _dropDownService = dropDownService; }
public ClubController( IClubService clubService, IAuthorizationService authService, IMapper mapper) { _clubService = clubService; _authService = authService; _mapper = mapper; }
public PlayerController( IPlayerService playerService, ICountryService countryService, IClubService clubService) { this.playerService = playerService; this.countryService = countryService; this.clubService = clubService; }
public TeamPositionController( ITeamPositionService teamPositionService, ISeasonService seasonService, IClubService clubService) { this.teamPositionService = teamPositionService; this.seasonService = seasonService; this.clubService = clubService; }
public ManagerController( IManagerService managerService, ICountryService countryService, IClubService clubService) { this.managerService = managerService; this.countryService = countryService; this.clubService = clubService; }
public LocalServiceImporter( ISeriesService seriesService, IClubService clubService, IBoatClassService classService) { _coreSeriesService = seriesService; _coreClubService = clubService; _coreClassService = classService; }
public ClubController(IClubService clubService, IClubAdministrationService clubAdministrationService, IClubMembersService clubMembersService, IUserManagerService userManagerService, IMapper mapper) { _clubService = clubService; _clubAdministrationService = clubAdministrationService; _clubMembersService = clubMembersService; _userManagerService = userManagerService; _mapper = mapper; }
public override void Setup() { base.Setup(); #if UNIT ClubService = new ClubService(WebClient); #elif INT ClubService = ServiceLocator.Get <IClubService>(); #endif }
public ClubController(ILoggerService <ClubController> logger, IClubService ClubService, IClubMembersService ClubMembersService, IMapper mapper) { _logger = logger; _ClubService = ClubService; _ClubMembersService = ClubMembersService; _mapper = mapper; }
public ClubController( IUserService users, IMusicGenreService genres, IImageService images, IClubService clubs) { this.users = users; this.genres = genres; this.images = images; this.clubs = clubs; }
public HomeController( IUserService userService, IFavoriteService favorService, IClubService clubService, ICityService cityService) { this.userService = userService; this.favorService = favorService; this.clubService = clubService; this.cityService = cityService; }
public ClubsController( IClubService clubs, IClubAnonymousReviewService anonymousReviews, IClubHiddenImageService hiddenImages, IClubHiddenImageVoteService hiddenImagesVotes) { this.clubs = clubs; this.anonymousReviews = anonymousReviews; this.hiddenImages = hiddenImages; this.hiddenImagesVotes = hiddenImagesVotes; }
public ScoringSystemController( IClubService clubService, IScoringService scoringService, IAuthorizationService authService, IMapper mapper) { _clubService = clubService; _scoringService = scoringService; _authService = authService; _mapper = mapper; }
public MatchService(IMatchRepository matchRepository, IMapper mapper, IClubService clubService) { _clubService = clubService; _mapper = mapper; _matchRepository = matchRepository; }
public UploadService(IUserService userService, IClubService clubService, IHostingEnvironment appEnvironment) { _userService = userService; _clubService = clubService; _appEnvironment = appEnvironment; }
public ClubsController(IClubService ClubService) { _ClubService = ClubService; }
/// <summary> /// Constructor. /// </summary> /// <param name="clubService"></param> public ClubController(IClubService clubService) { _clubService = clubService; }
public override void Setup() { base.Setup(); #if UNIT ClubService = new ClubService(WebClient); #elif INT ClubService = ServiceLocator.Get<IClubService>(); #endif }