private IList <SearchResult <Player> > GetCachedSoccers(string query) { IList <SearchResult <Player> > books = null; IDatabase cache = redisConnection.GetDatabase(); var serializedBooks = cache.StringGet(query + ":soccers"); if (!serializedBooks.IsNullOrEmpty) { books = JsonConvert.DeserializeObject <IList <SearchResult <Player> > >(serializedBooks); } else { books = azureSearch.SearchSoccers(query); cache.StringSet(query + ":soccers", JsonConvert.SerializeObject(books), TimeSpan.FromSeconds(30)); } return(books); }