You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MyCacheOutputAttribute.cs 651B

1234567891011121314151617
  1. using System.Configuration;
  2. using iiie.CacheControl.Business.Attributes;
  3. using iiie.CacheControl.Business.OutputCache;
  4. namespace CacheControl_test.Controllers
  5. {
  6. public class MyCacheOutputAttribute : TimeCacheControlAttribute
  7. {
  8. public MyCacheOutputAttribute(int seconds, bool excludeGet = false, bool excludePost = false) : base(seconds)
  9. {
  10. CacheType = OutputCacheType.DataBase;
  11. ExcludePostFromCacheKey = excludePost;
  12. ExcludeQueryStringFromCacheKey = excludeGet;
  13. OutputCacheData = ConfigurationManager.ConnectionStrings["ConnectionString42"].ConnectionString;
  14. }
  15. }
  16. }