Esempio n. 1
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc(options => options.EnableEndpointRouting = false);

            var customFilters = new CustomScriptMethods();

            var i = 1;

            DocLinks.ForEach((page, title) => customFilters.DocsIndex[i++] = new KeyValuePair <string, string>(
                                 "https://sharpscript.net/docs/" + page,
                                 title
                                 ));

            var context = new ScriptContext {
                ScriptMethods = { customFilters }
            };

            services.AddSingleton(context);
            services.AddSingleton(context.Pages);
        }
Esempio n. 2
0
        public override void Configure(Container container)
        {
            SetConfig(new HostConfig
            {
                HandlerFactoryPath = "api",
            });

            var customScripts = new CustomScriptMethods();

            var i = 1;

            DocLinks.ForEach((page, title) => customScripts.DocsIndex[i++] = new KeyValuePair <string, string>(
                                 "https://sharpscript.net/docs/" + page,
                                 title
                                 ));

            Plugins.Add(new SharpPagesFeature
            {
                ScriptMethods = { customScripts }
            });

            ControllerBuilder.Current.SetControllerFactory(new FunqControllerFactory(container));
        }