Ejemplo n.º 1
0
        public virtual void ValidateRequest(HttpContextBase httpContext, ICustomerHost host)
        {
            if (httpContext == null)
            {
                throw new ArgumentNullException(nameof(httpContext));
            }

            var customerInstance = host.GetOrStartCustomerInstance(httpContext.Request.Url);

            if (customerInstance == null)
            {
                CustomerNotFound(httpContext.Response);
            }
            else
            {
                // Make the Customer instance available for the request
                httpContext.Items[Constants.CurrentCustomerInstanceKey] = customerInstance;
            }
        }
Ejemplo n.º 2
0
 public TestsHttpContextInitialize(Uri siteUri, User currentUser, ICustomerHost customerHost)
 {
     _siteUri      = siteUri;
     _currentUser  = currentUser;
     _customerHost = customerHost;
 }