示例#1
0
 public VacancyReadService(IVacancyRepository vacancyRepository, IMapper mapper, IMapAPIReadService mapAPIReadService)
 {
     this.vacancyRepository = vacancyRepository;
     this.mapper            = mapper;
     this.mapAPIReadService = mapAPIReadService;
     this.queryBuilder      = new QueryBuilder();
     this.locationHelper    = new LocationHelper();
 }
示例#2
0
 public CompanyReadService(ICompanyRepository companyRepository, IMapper mapper, IMapAPIReadService mapAPIReadService, IConfiguration config)
 {
     this.companyRepository = companyRepository;
     this.mapper            = mapper;
     this.mapAPIReadService = mapAPIReadService;
     this.queryBuilder      = new QueryBuilder();
     this.locationHelper    = new LocationHelper();
     this.config            = config;
 }
示例#3
0
 public UserReadService(IUserRepository userRepository, IMapper mapper,
                        IMapAPIReadService mapAPIReadService, IReviewReadService reviewReadService, IVacancyReadService vacancyReadService)
 {
     _userRepository         = userRepository;
     _mapper                 = mapper;
     this.queryBuilder       = new QueryBuilder();
     this.mapAPIReadService  = mapAPIReadService;
     this.reviewReadService  = reviewReadService;
     this.vacancyReadService = vacancyReadService;
 }
示例#4
0
 public UserCommandService(IUserRepository userRepository, IMapper mapper,
                           IMapAPIReadService mapAPIReadService, IUserReadService userReadService,
                           IMailClient mailClient, IOptionReadService optionReadService, IConfiguration config)
 {
     this.userRepository    = userRepository;
     this.mapper            = mapper;
     this.mapAPIReadService = mapAPIReadService;
     this.queryBuilder      = new QueryBuilder();
     this.userReadService   = userReadService;
     this.mailClient        = mailClient;
     this.optionReadService = optionReadService;
     this.config            = config;
 }
示例#5
0
        public void AddLocationFilter(ref Dictionary <string, object> parameters, IMapAPIReadService mapAPIReadService, ref IQueryBuilder queryBuilder, char tablename, string columnname, string countryName = null,
                                      string municipalityName = null, string cityName = null, int?locationRange = null)
        {
            if (!(cityName is null) && !(locationRange is null))
            {
                // Use Map API
                Coordinates coordinates = mapAPIReadService.GetMapCoordinates(cityName, countryName, municipalityName);

                if (!(coordinates is null))
                {
                    parameters.Add("@latitude", coordinates.Latitude);
                    parameters.Add("@longitude", coordinates.Longitude);
                    parameters.Add("@rangeKm", locationRange);

                    queryBuilder.AddSelect(String.Format(@"(
                        6371 * acos(
                          cos(radians(@latitude))
                          * cos(radians({0}.{1}_breedtegraad))
                          * cos(radians({0}.{1}_lengtegraad) - radians(@longitude))
                          + sin(radians(@latitude))
                          * sin(radians({0}.{1}_breedtegraad))
                        )) as distance", tablename, columnname));
                    queryBuilder.AddHaving("distance < @rangeKm");
                }