/// <summary> /// Gets a list of Billboard Hot 100 songs from a given year /// from the SQL DB using Entity /// </summary> /// <param name="year"></param> /// <returns></returns> public JsonResult GetYearList(int year) { var redisLookup = new RedisSongList(new AzureSQLSongList(), new AzureRedisCache()); // var redisLookup = new RedisSongList(new AwsSQLSongList(), new AwsRedisCache()); var list = redisLookup.GetYearList(year); return(Json(list, JsonRequestBehavior.AllowGet)); }
/// <summary> /// Asynchronously pre-load all year lists into the Redis cache /// Gets called upon page load in Spotify.js /// </summary> /// <returns></returns> public EmptyResult PreloadLists() { Task <Dictionary <int, List <Billboard100Songs> > > t = Task.Run(() => { var redisLookup = new RedisSongList(new AwsSQLSongList(), new AwsRedisCache()); return(redisLookup.GetAllYearLists()); }); return(null); }