/// <summary>
        /// 从程序集中获取功能信息(如MVC的Controller-Action)
        /// </summary>
        public void Initialize()
        {
            Check.NotNull(FunctionTypeFinder, nameof(FunctionTypeFinder));

            Type[]      functionTypes = FunctionTypeFinder.FindAll(true);
            TFunction[] functions     = GetFunctions(functionTypes);
            SyncToDatabase(functions);
            RefreshCache();
        }
示例#2
0
        /// <summary>
        /// 从程序集中获取功能信息(如MVC的Controller-Action)
        /// </summary>
        public void Initialize()
        {
            Check.NotNull(FunctionTypeFinder, nameof(FunctionTypeFinder));

            Type[]      functionTypes = FunctionTypeFinder.FindAll(true);
            TFunction[] functions     = GetFunctions(functionTypes);

            ServiceLocator.Instance.ExcuteScopedWork(provider =>
            {
                SyncToDatabase(provider, functions);
            });

            RefreshCache();
        }
        /// <summary>
        /// 从程序集中获取功能信息(如MVC的Controller-Action)
        /// </summary>
        public void Initialize()
        {
            Check.NotNull(FunctionTypeFinder, nameof(FunctionTypeFinder));

            Type[]      functionTypes = FunctionTypeFinder.FindAll(true);
            TFunction[] functions     = GetFunctions(functionTypes);
            Logger.LogInformation($"功能信息初始化,共找到{functions.Length}个功能信息");

            _serviceProvider.ExecuteScopedWork(provider =>
            {
                SyncToDatabase(provider, functions);
            });

            RefreshCache();
        }
        /// <summary>
        /// 从程序集中获取功能信息(如MVC的Controller-Action)
        /// </summary>
        public void Initialize()
        {
            var auto = options.LocalOption.AutoFunctions;

            if (!auto)
            {
                Logger.LogInformation($"已经屏蔽功能信息初始化功能");
                return;
            }
            Check.NotNull(FunctionTypeFinder, nameof(FunctionTypeFinder));

            Type[]     functionTypes = FunctionTypeFinder.FindAll(true);
            Function[] functions     = GetFunctions(functionTypes);
            Logger.LogInformation($"功能信息初始化,共找到{functions.Length}个功能信息");

            _serviceProvider.ExecuteScopedWork(provider =>
            {
                SyncToDatabase(provider, functions);
            });

            RefreshCache();
        }