public ABTester Start()
        {
            var context = HttpContext.Current;

            if (context == null)
            {
                return(null);
            }

            var url  = context.Request.Url;
            var path = context.Request.AppRelativeCurrentExecutionFilePath.Substring(1);

            // don't profile /content or /scripts, either - happens in web.dev
            foreach (var ignored in ABTester.Settings.IgnoredPaths ?? new string[0])
            {
                if (path.ToUpperInvariant().Contains((ignored ?? "").ToUpperInvariant()))
                {
                    return(null);
                }
            }

            var result = new ABTester(context);

            Current = result;

            //TODO - User Storage
            result.User = ABTester.Settings.UserProvider.GetUser(context.Request);

            return(result);
        }
示例#2
0
        public ABTester Start()
        {
            var context = HttpContext.Current;
            if (context == null) return null;

            var url = context.Request.Url;
            var path = context.Request.AppRelativeCurrentExecutionFilePath.Substring(1);

            // don't profile /content or /scripts, either - happens in web.dev
            foreach (var ignored in ABTester.Settings.IgnoredPaths ?? new string[0])
            {
                if (path.ToUpperInvariant().Contains((ignored ?? "").ToUpperInvariant()))
                    return null;
            }

            var result = new ABTester(context);
            Current = result;

            //TODO - User Storage
            result.User = ABTester.Settings.UserProvider.GetUser(context.Request);

            return result;
        }