Пример #1
0
        public IQueryable<Application> BuildSearchQuery(List<SearchParameter> parameters, IQueryable<Application> query)
        {
            var area = parameters.AreaOrDefault();

            if (area.IsNotNull())
            {
                if (area.ParameterValue.IsNotNullOrEmpty())
                {
                    return query.MatchesRequirement(RequirementType.Area, area.ParameterValue.ToUpper());
                }
            }

            return query;
        }
Пример #2
0
        public List<Property> Search(List<SearchParameter> searchParameters, Ordering order, Filtering filter)
        {
            var properties = from property in
                _propertiesContext.Properties.Active()
                .Include(x => x.Landlord)
                .Include(x => x.PropertyDetails)
                .Include(x => x.PropertyPhotos)
                select property;

            properties = _searchQueryFactory.GetQueries()
                .Aggregate(properties, (current, query) => query.BuildSearchQuery(searchParameters, current));

            return properties.OrderProperties(order).Filter(filter).ToList().FilterByArea(searchParameters.AreaOrDefault()).ToList();
        }
Пример #3
0
        public IQueryable<Core.Objects.Property> BuildSearchQuery(List<SearchParameter> parameters, IQueryable<Core.Objects.Property> query)
        {
            var area = parameters.AreaOrDefault();

            if (area.IsNotNull())
            {
                if (area.ParameterValue.IsNotNullOrEmpty())
                {
                    return query.MatchesArea(area.ParameterValue.ToUpper());
                }
            }

            return query;
        }