コード例 #1
0
        /// <summary>
        /// gets the pads for launch
        /// </summary>
        /// <returns></returns>
        public List <PadModel> GetPads()
        {
            //reaches back to redis cache to check if it exists first.
            RedisCacheManager cache = new RedisCacheManager();
            var pads = cache.GetCache <List <PadModel> >("GetPads");

            //if it doesn't, it pulls from the service.
            if (pads == null)
            {
                pads = _launch.GetPads();
                //adds items to cache.
                cache.AddCache(pads, "GetPads");
            }
            _log.LogInformation("GOT All Launch Pads " + _appSettings.SpaceXApiVersion);
            return(pads);
        }