Пример #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            pluginManager = new EvolutionPluginManager(_hostingEnvironment, services);

            services.AddApplicationInsightsTelemetry(Configuration);
            //mvc
            var mvcBuilder = services.AddEvolutionMVCService();

            //加载插件
            GloableConfiguration.PluginAssemblies = pluginManager.LoadPluginAssembly(mvcBuilder);
            //cache
            services.AddEvolutionCacheService(Configuration);
            //session
            services.AddSession((SessionOptions options) =>
            {
                options.IdleTimeout = TimeSpan.FromMinutes(30);
                options.CookieName  = ".MyApplication";
            });

            //database
            services.AddEvolutionDBService(pluginManager, Configuration);
            //plugins injection entityframework and service dependency
            pluginManager.AddPluginEFService(Configuration);
            //inject
            services.InjectEvolutionDependency();
            pluginManager.InjectEvolutionDependency();
        }
Пример #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            pluginManager = new EvolutionPluginManager(_hostingEnvironment, services);

            services.AddApplicationInsightsTelemetry(Configuration);

            //mvc
            var mvcBuilder = services.AddEvolutionMVCService();

            //配置跨域
            services.AddCors();

            //加载插件
            GloableConfiguration.PluginAssemblies = pluginManager.LoadPluginAssembly(mvcBuilder);
            //cache
            services.AddEvolutionCacheService(Configuration);

            //database
            services.AddEvolutionDBService(pluginManager, Configuration);
            //plugins injection entityframework and service dependency
            pluginManager.AddPluginEFService(Configuration);
            //inject
            services.InjectEvolutionDependency();
            pluginManager.InjectEvolutionDependency();
        }