Esempio n. 1
0
        /// <summary>
        /// Method to get all promos for today
        /// </summary>
        /// <returns>List of promos</returns>
        public List <Promo> GetPromosForToday()
        {
            var dateStart = DateTime.Now;

            Performancelog.Debug($"Start,PromoManager,GetPromosForToday,{string.Empty},{DateTime.Now:hh.mm.ss.ffffff}");

            var promosForToday = CacheManager.GetPromosForToday();

            if (promosForToday != null && promosForToday.Count != 0)
            {
                return(promosForToday);
            }
            promosForToday = _promoService.GetPromosForToday();
            Performancelog.Debug($"End,PromoManager,GetPromosForToday,{DateTime.Now.Subtract(dateStart).TotalMilliseconds},{DateTime.Now:hh.mm.ss.ffffff}");
            CacheManager.AddPromosForToday(promosForToday);
            return(promosForToday);
        }