12345678910111213141516171819202122232425262728293031323334353637 |
- using System;
- using iiie.CacheControl.Attributes;
- using iiie.CacheControl.DBO;
-
- namespace iiie.CacheControl.Business.Attributes
- {
-
-
-
- public class TimeCacheControlAttribute : CacheControlAttribute
- {
-
-
-
- protected int Seconds { get; set; }
-
-
-
-
- public TimeCacheControlAttribute(int seconds, bool excludeGet = false, bool excludePost = false)
- {
- Seconds = seconds;
- ExcludePostFromCacheKey = excludePost;
- ExcludeQueryStringFromCacheKey = excludeGet;
- }
-
-
-
-
-
-
- protected override bool IsValid(CacheDbo data)
- {
- return data.Date.AddSeconds(Seconds) >= DateTime.Now;
- }
- }
- }
|