/// <summary>
        /// 查询城市价格趋势
        /// </summary>
        /// <returns>城市价格趋势,总页数</returns>
        public IEnumerable<object> Get()
        {
            int totalPage = 0;
            List<CityPriceTrend> result;

            var queryString = Request.GetQueryNameValuePairs();
            var queryConditions = new CityPriceTrendQueryConditions();
            queryConditions.GetValues(queryString);

            CityPriceTrendFunction cityPriceTrendFunction = new CityPriceTrendFunction();
            cityPriceTrendFunction.QueryCityPriceTrend(queryConditions, out result, out totalPage);

            List<object> objectResult = new List<object>() { result, new { totalPage = totalPage } };
            return objectResult;
        }
        /// <summary>
        /// 删除城市价格趋势
        /// </summary>
        /// <param name="entity">城市价格趋势</param>
        public HttpResponseMessage Delete([FromBody]CityPriceTrend entity)
        {
            if (entity == null)
            {
                return new HttpResponseMessage(HttpStatusCode.BadRequest);
            }
            else
            {
                CityPriceTrendFunction cityPriceTrendFunction = new CityPriceTrendFunction();
                int error = cityPriceTrendFunction.DeleteCityPriceTrend(entity);
                var response = GetResponse.PriceTrendResponse(error);

                return response;
            }
        }
        /// <summary>
        /// 删除城市价格趋势
        /// </summary>
        /// <param name="city">城市</param>
        public HttpResponseMessage Delete(string city)
        {
            if (string.IsNullOrEmpty(city))
            {
                return new HttpResponseMessage(HttpStatusCode.BadRequest);
            }
            else
            {
                var entity = new CityPriceTrend() { City = city };
                CityPriceTrendFunction cityPriceTrendFunction = new CityPriceTrendFunction();
                int error = cityPriceTrendFunction.DeleteCityPriceTrend(entity);
                var response = GetResponse.PriceTrendResponse(error);

                return response;
            }
        }
        /// <summary>
        /// 查询单个城市价格趋势
        /// </summary>
        /// <param name="city">城市</param>
        /// <returns>城市价格趋势,总页数</returns>
        public IEnumerable<object> Get(string city)
        {
            int totalPage = 0;
            List<CityPriceTrend> result;

            var queryConditions = new CityPriceTrendQueryConditions() { City = city };

            CityPriceTrendFunction cityPriceTrendFunction = new CityPriceTrendFunction();
            cityPriceTrendFunction.QueryCityPriceTrend(queryConditions, out result, out totalPage);

            List<object> objectResult = new List<object>() { result, new { totalPage = totalPage } };
            return objectResult;
        }
        /// <summary>
        /// 新增城市价格趋势
        /// </summary>
        /// <param name="auto">是否添加当前城市均价到价格趋势</param>
        public HttpResponseMessage Post(int auto)
        {
            if (auto == 1)
            {
                CityPriceTrendFunction cityPriceTrendFunction = new CityPriceTrendFunction();
                int error = cityPriceTrendFunction.AddCurrentCityPriceTrends();
                var response = GetResponse.PriceTrendResponse(error);

                return response;
            }
            else
            {
                return new HttpResponseMessage(HttpStatusCode.BadRequest);
            }
        }