Beispiel #1
0
        public async Task <IActionResult> GetListingsAverageReviewsFiltered(int neighbourhoodId)
        {
            var key       = $"PropertyTypes-{neighbourhoodId}";
            var cacheItem = await _cache.Get(key);

            if (cacheItem != null)
            {
                return(Ok(cacheItem));
            }

            var response = Newtonsoft.Json.JsonConvert.SerializeObject(
                await ChartJson.CreatePropertyType(_listingsRepo.AllStats("propertyType", neighbourhoodId))
                );

            _cache.Set(key, response);

            return(Ok(response));
        }
Beispiel #2
0
        public async Task <IActionResult> GetListingsPropertiesTypes()
        {
            const string key       = "PropertyTypes";
            var          cacheItem = await _cache.Get(key);

            if (cacheItem != null)
            {
                return(Ok(cacheItem));
            }

            var response = Newtonsoft.Json.JsonConvert.SerializeObject(
                await ChartJson.CreatePropertyType(_listingsRepo.AllStats("propertyType"))
                );

            _cache.Set(key, response);

            return(Ok(response));
        }