Ejemplo n.º 1
0
        private static DateTime getCacheDutaion(Enums.CacheDuration duration)
        {
            switch (duration)
            {
            case Enums.CacheDuration.Small:
                return(DateTime.Now.AddMinutes(4));

            case Enums.CacheDuration.Medium:
                return(DateTime.Now.AddMinutes(30));

            case Enums.CacheDuration.Large:
                return(DateTime.Now.AddHours(2));

            case Enums.CacheDuration.Huge:
                return(DateTime.Now.AddHours(4));

            default:
                return(DateTime.Now.AddMinutes(10));
            }
        }
Ejemplo n.º 2
0
 public static void SetCache(string key, object value, Enums.CacheDuration duration)
 {
     SetCache(key, value, getCacheDutaion(duration));
 }