Пример #1
0
        public void OnActionExecuting(ActionExecutingContext actionContext)
        {
            if (!actionContext.HttpContext.User.Identity.IsAuthenticated)
            {
                return;
            }
            IEnumerable <String> modules;
            var currentModule               = GetValue(actionContext, CurrentModuleKey);
            var currentMetadataId           = GetValue(actionContext, CurrentMetadataKey);
            var currentMetadataParameter    = GetValue(actionContext, CurrentMetadataParameterKey);
            ApplicationLookupContext appCtx = null;

            if (currentMetadataId != null)
            {
                appCtx = new ApplicationLookupContext {
                    MetadataId = currentMetadataId
                };
            }
            ContextLookuper.AddContext(new ContextHolder()
            {
                Module = currentModule, ApplicationLookupContext = appCtx, MetadataParameters = PropertyUtil.ConvertToDictionary(currentMetadataParameter)
            }, true);
        }