Example #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;
            }
        }
Example #2
0
 private CustomerInstance GetCustomerInstance()
 {
     return(_customerHost.GetOrStartCustomerInstance(_siteUri));
 }