public BaseServiceFacade(SessionService sessionService)
        {
            // session gone, major problem!
            if (HttpContext.Current.Session != null)
            {
                UserKey = Convert.ToString(HttpContext.Current.Session["UserKey"]);
            }

            // ensure valid link to server in place - create a new user key!
            var request = new GetIDRequest {
                UserKey = UserKey
            };
            var response = sessionService.GetID(request);

            if (!response.Success)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(UserKey))
            {
                UserKey = response.UserKey;
            }

            if (HttpContext.Current.Session != null)
            {
                HttpContext.Current.Session["UserKey"] = response.UserKey;
            }
        }
        public static void SetUpFacade(ISessionService sessionService)
        {
            // ensure valid link to server in place - create a new user key!
            var request = new GetIDRequest { UserKey = WindowsContext.UserKey };
            var response = sessionService.GetID(request);

            if (!response.Success) return;

            WindowsContext.UserKey = response.UserKey;
        }
示例#3
0
 public GetIDResponse GetID(GetIDRequest usePatternRequest)
 {
     return(Channel.GetID(usePatternRequest));
 }