TradeMe.Api.Client.SearchMethods.SearchResidentialProperties C# (CSharp) Method

SearchResidentialProperties() public method

Performs the search method: Search Residential Property.

Creates a query string using the parameters provided - parameters can be null if they are not required for the request.
public SearchResidentialProperties ( string searchString, PropertySortOrder sortOrder, int page, int rows, int region, int district, int suburb, System.DateTime dateFrom, int priceMin, int priceMax, int bathroomsMin, int bathroomsMax, int bedroomsMin, int bedroomsMax, int areaMax, int areaMin, int landAreaMin, int landAreaMax, PropertyType propertyType, bool adjacentSuburbs ) : global::Properties
searchString string One or more keywords to use in a search query.
sortOrder PropertySortOrder Sort the returned record-set by a single specified sort order.
page int Page number.
rows int Number of rows per page.
region int Specifies the search region ID.
district int Specifies the search district ID.
suburb int Specifies the search suburb ID.
dateFrom System.DateTime Specifies minimum start date for returned listings.
priceMin int Minimum property price.
priceMax int Maximum property price.
bathroomsMin int Minimum number of bathrooms.
bathroomsMax int Maximum number of bathrooms.
bedroomsMin int Minimum number of bedrooms.
bedroomsMax int Maximum number of bedrooms.
areaMax int Maximum square area in square meters.
areaMin int Minimum floor area in square meters.
landAreaMin int Minimum land area in square meters.
landAreaMax int Maximum land area in square meters.
propertyType PropertyType The type of the property.
adjacentSuburbs bool Indicates whether the search should include listings in adjacent suburbs.
return global::Properties
        public global::Properties SearchResidentialProperties(
            string searchString,
            PropertySortOrder sortOrder,
            int? page,
            int? rows,
            int? region,
            int? district,
            int? suburb,
            DateTime dateFrom,
            int? priceMin,
            int? priceMax,
            int? bathroomsMin,
            int? bathroomsMax,
            int? bedroomsMin,
            int? bedroomsMax,
            int? areaMax,
            int? areaMin,
            int? landAreaMin,
            int? landAreaMax,
            PropertyType propertyType,
            bool? adjacentSuburbs)
        {
            var url = String.Format(Constants.Culture, "{0}{1}/{2}/Residential{3}", _connection.BaseUrl, Constants.SEARCH, Constants.PROPERTY, Constants.XML);
            _addAnd = false;
            var conditions = "?";

            // create the parameters for the query string
            conditions += this.PropertyHelper(searchString, sortOrder.ToString(), page, rows, region, district, suburb, dateFrom, priceMin, priceMax, landAreaMin, landAreaMax);
            conditions += ResidentialPropertyHelper(bathroomsMin, bathroomsMax, bedroomsMax, bedroomsMin, areaMax, areaMin, propertyType.ToString(), adjacentSuburbs);

            // add the parameters to the query string if there are any
            if (conditions.Equals("?"))
            {
                url += conditions;
            }

            // perform the request
            return this.PropertyConnectionHelper(url);
        }