예제 #1
0
        public UEditorService(IHostingEnvironment env, UEditorActionCollection actions)
        {
            //这里要注意区分Web根目录 和 内容根目录的区别:

            //Web根目录是指提供静态内容的根目录,即asp.net core应用程序根目录下的wwwroot目录
            //内容根目录是指应用程序的根目录,即asp.net core应用的应用程序根目录
            //Config.WebRootPath = env.WebRootPath;
            Config.WebRootPath = env.ContentRootPath;
            actionList         = actions;
        }
        public static UEditorActionCollection AddUEditorService(
            this IServiceCollection services,
            string configFile = "config.json",
            bool isCache      = false)
        {
            Config.ConfigFile = configFile;
            Config.noCache    = !isCache;

            var actions = new UEditorActionCollection();

            services.AddSingleton(actions);
            services.AddSingleton <UEditorService>();

            return(actions);
        }