public static List <League> GetLeagueData() { List <League> leagueData = redis.Cache.GetObject <List <League> >("leagueData"); if (leagueData == null) { External.GetLeagues(); leagueData = redis.Cache.GetObject <List <League> >("leagueData"); } return(leagueData); }
public static void Initialize() { redis = new Context("localhost:6379", new JsonSerializer()); leagueData = External.GetLeagues();; }