Example #1
0
        public CachingKeysMiddleware(CachingManager cachingManager, IOptions <CachingOptions> cachingOptions, RequestDelegate next)
        {
            this.cachingOptions = cachingOptions.Value;
            this.cachingManager = cachingManager;

            this.next = next;
        }
Example #2
0
        public CachingFilter(CachingManager cachingManager, IOptions <CachingOptions> cachingOptions)
        {
            Guard.NotNull(cachingManager);
            Guard.NotNull(cachingOptions);

            this.cachingOptions = cachingOptions.Value;
            this.cachingManager = cachingManager;
        }
        public CachingKeysMiddleware(CachingManager cachingManager, IOptions <CachingOptions> cachingOptions, RequestDelegate next)
        {
            Guard.NotNull(cachingManager, nameof(cachingManager));
            Guard.NotNull(cachingOptions, nameof(cachingOptions));
            Guard.NotNull(next, nameof(next));

            this.cachingOptions = cachingOptions.Value;
            this.cachingManager = cachingManager;

            this.next = next;
        }
Example #4
0
        public CachingFilterTests()
        {
            A.CallTo(() => httpContextAccessor.HttpContext)
            .Returns(httpContext);

            cachingManager = new CachingManager(httpContextAccessor, Options.Create(cachingOptions));

            var actionContext = new ActionContext(httpContext, new RouteData(), new ActionDescriptor());
            var actionFilters = new List <IFilterMetadata>();

            executingContext = new ActionExecutingContext(actionContext, actionFilters, new Dictionary <string, object>(), this);
            executedContext  = new ActionExecutedContext(actionContext, actionFilters, this)
            {
                Result = new OkResult()
            };

            sut = new CachingFilter(cachingManager);
        }
Example #5
0
        public CachingFilter(CachingManager cachingManager)
        {
            Guard.NotNull(cachingManager, nameof(cachingManager));

            this.cachingManager = cachingManager;
        }
Example #6
0
 public CachingFilter(CachingManager cachingManager)
 {
     this.cachingManager = cachingManager;
 }