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(); }
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; }
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; }
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; }
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"); }