public ActionResult GetActivities(double?lat, double?lng, double?radius, [FromQuery] string[] source, [FromQuery] string[] kind, [FromQuery] string[] tag, [FromQuery] string[] excludeTag, [FromQuery] string[] disabilitySupport, [FromQuery] string[] weekdays, string gender = null, double?minCost = null, double?maxCost = null, string from = null, string to = null, long?minTime = null, long?maxTime = null, long?minAge = null, long?maxAge = null) { #region Variable declaration or assignment lat = lat ?? defaultLatitude; lng = lng ?? defaultLongitude; radius = radius ?? defaultRadius; string sources = null; string kinds = null; string tags = null; string excludeTags = null; string disabilitySupports = null; string days = null; if (source.Length > 0) { sources = string.Join(",", source); } if (kind.Length > 0) { kinds = string.Join(",", kind); } if (tag.Length > 0) { tags = string.Join(",", tag); } if (excludeTag.Length > 0) { excludeTags = string.Join(",", excludeTag); } if (disabilitySupport.Length > 0) { disabilitySupports = string.Join(",", disabilitySupport); } if (weekdays.Length > 0) { days = string.Join(",", weekdays); } #endregion var oRequestCode = new Random().Next(0, int.MaxValue); var oRequestTime = DateTime.Now; string Model = string.Concat("{lat:", lat, ",lng:", lng, ",radius:", radius, ",sources:", sources, ",kinds:", kinds, ",tags:", tags, ",excludeTags:", excludeTags, ",disabilitySupports:", disabilitySupports, ",days:", days, ",gender:", gender, ",minCost:", minCost, ",maxCost:", maxCost, ",from:", from, ",to:", to, ",minTime:", minTime, ",maxTime:", maxTime, ",minAge:", minAge, ",maxAge:", maxAge, "}"); var oResult = MemoryCacheHelper.GetValue(Model + "-Activities"); var activities = new List <string>(); LogHelper.InsertServiceLogs("search/activities (GetActivities) (" + oRequestCode + ")", Model, oRequestTime); if (oResult == null) { activities = FeedHelper.GetActivities(lat, lng, radius, sources, kinds, tags, excludeTags, disabilitySupports, days, minCost, maxCost, gender, minTime, maxTime, minAge, maxAge, from, to); MemoryCacheHelper.Add(Model + "-Activities", activities, DateTimeOffset.UtcNow.AddHours(2)); } else { activities = oResult as List <string>; } LogHelper.InsertServiceLogs("search/activities (GetActivities) - Response (" + oRequestCode + ")", Model, oRequestTime, DateTime.Now); return(Ok(new { items = activities })); }