A IContextProvider for webapi that puts request data to the context dictionary
상속: IContextProvider
예제 #1
0
        /// <summary>
        /// Get context data from <see cref="HttpActionContext" />
        /// </summary>
        /// <param name="actionContext"></param>
        /// <returns></returns>
        protected virtual IDictionary <string, object> GetInvocationContext(HttpActionContext actionContext)
        {
            var provider = new WebApiContextProvider(actionContext);
            var context  = provider.GetContext();

            context[Global.__flatwhite_outputcache_attribute] = this;
            return(context);
        }
예제 #2
0
        /// <summary>
        /// Get context data from <see cref="HttpActionContext" />
        /// </summary>
        /// <param name="actionContext"></param>
        /// <returns></returns>
        protected virtual IDictionary <string, object> GetInvocationContext(HttpActionContext actionContext)
        {
            var provider = new WebApiContextProvider(actionContext);
            var context  = provider.GetContext();

            context[Global.__flatwhite_outputcache_attribute]   = this;
            context[WebApiExtensions.__webApi_dependency_scope] = actionContext.Request.GetDependencyScope();
            return(context);
        }
 /// <summary>
 /// Get context data from <see cref="HttpActionContext" />
 /// </summary>
 /// <param name="actionContext"></param>
 /// <returns></returns>
 protected virtual IDictionary<string, object> GetInvocationContext(HttpActionContext actionContext)
 {
     var provider = new WebApiContextProvider(actionContext);
     var context = provider.GetContext();
     context[Global.__flatwhite_outputcache_attribute] = this;
     context[WebApiExtensions.__webApi_dependency_scope] = actionContext.Request.GetDependencyScope();
     return context;
 }