Beispiel #1
0
        /// <summary>
        /// 为保存session使用的工厂创建
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="httpRequest"></param>
        /// <param name="businessRequest"></param>
        /// <param name="dto"></param>
        /// <returns></returns>
        public static SessionManager <T> Create <T>(
            IHttpRequest httpRequest, T businessRequest, SessionDto dto = null)
        {
            switch (GlobalConfig.SessionType)
            {
            case "CACHE":
            {
                return(new CacheSessionManager <T>(httpRequest, businessRequest, dto));
            }

            case "SERVICESTACK":
            {
                return(new ServiceStackSessionManager <T>(httpRequest, businessRequest, dto));
            }

            default:
            {
                throw new Exception("没有找到合适的session操作对象");
            }
            }
        }
Beispiel #2
0
 public ServiceStackSessionManager(
     IHttpRequest httpRequest, T businessRequest, SessionDto dto)
     : base(httpRequest, businessRequest, dto)
 {
 }
Beispiel #3
0
 protected SessionManager(IHttpRequest httpRequest, T businessRequest, SessionDto sessionDto = null)
 {
     this.HttpRequest     = httpRequest;
     this.BusinessRequest = businessRequest;
     this.SessionDto      = sessionDto;
 }
 public CacheSessionManager(IHttpRequest httpRequest, T businessRequest, SessionDto sessionDto)
     : base(httpRequest, businessRequest, sessionDto)
 {
 }