/// <summary> /// Fetches the cache data and converts to an array. /// </summary> /// <returns>The result list.</returns> private ActionResult <IStatusReply> FetchCacheEntries(DeviceSupportedFeatures features) { try { var cacheMaintenance = new CacheMaintenance(true); return(new HostsSupportingFeatureResult(cacheMaintenance.FetchEntryList().Where(e => ((e.SystemData?.SupportedFeatures ?? DeviceSupportedFeatures.None) & features) == features).Select(cacheEntry => new HostInfoReply(cacheEntry.Address, cacheEntry.SystemData, cacheEntry.ApiUsed, cacheEntry.LastModification)))); } catch (Exception ex) { return(this.BadRequest($"Error: {ex.Message}")); } }
/// <summary> /// Fetches the cache data and converts to an array. /// </summary> /// <returns>The result list.</returns> private ActionResult <IEnumerable <ICacheData> > FetchCacheEntries() { var cacheMaintenance = new CacheMaintenance(true); return(cacheMaintenance.FetchEntryList().ToArray()); }