private List <Host> GetHostsFromCache() { List <Host> hosts; try { byte[] fromRedisCache = _distributedCache.Get("AllSummaryHost"); if (fromRedisCache != null) { hosts = (List <Host>)ByteArrayToObject(fromRedisCache); } else { hosts = HostRepository.GetAll(); byte[] toRedisCache = ObjectToByteArray(hosts); _distributedCache.Set("AllSummaryHost", toRedisCache); } } catch { hosts = HostRepository.GetAll(); } return(hosts); }
public IEnumerable <Host> GetAll() { return(_hostrepository.GetAll()); }
public IList <Host> GetAll() { return(_hostRepository.GetAll("HostName", "Asc")); }