Пример #1
0
        private static AppBuilder UseYOYOFx(this AppBuilder app, Action <IRouteBuilder> routebuilderFunc = null, Action <YOYOFxOptions> configuration = null)
        {
            if (Application.CurrentApplication.ServiceProvider == null)
            {
                IServiceCollection sc = new ServiceCollection();
                sc.AddYOYOFx();
            }

            YOYOFxOptions options = new YOYOFxOptions();

            if (configuration != null)
            {
                configuration(options);
            }

            Application.CurrentApplication.SetOptions(options);

            IRouteBuilder routeBuilder = RouteBuilder.Builder;

            //default route role
            routeBuilder.Map("/{controller}/{action}/{id}/");

            if (routebuilderFunc != null)
            {
                routebuilderFunc(RouteBuilder.Builder);
            }

            return(app);
        }
Пример #2
0
        public static IApplicationBuilder UseYOYOFx(this IApplicationBuilder app, Action <IRouteBuilder> routebuilderFunc = null, Action <YOYOFxOptions> configuration = null)
        {
            YOYOFxOptions options = new YOYOFxOptions();

            if (configuration != null)
            {
                configuration(options);
            }

            options.Bootstrapper.Initialise();

            Application.CurrentApplication.SetOptions(options);

            IRouteBuilder routeBuilder = RouteBuilder.Builder;

            //default route role
            routeBuilder.Map("/{controller}/{action}/{id}/");

            if (routebuilderFunc != null)
            {
                routebuilderFunc(RouteBuilder.Builder);
            }

            app.UseOwin(p => p(next => Invoke));

            return(app);
        }
Пример #3
0
        public static IAppBuilder UseYOYOFx(this IAppBuilder app, Action<IRouteBuilder> routebuilderFunc = null, Action<Pipeline> setup = null, Action<YOYOFxOptions> configuration = null)
        {
            YOYOFxOptions options = new YOYOFxOptions();
            if (configuration != null)
                configuration(options);

            options.Bootstrapper.Initialise();

            Application.CurrentApplication.SetOptions(options);

            routebuilderFunc ( RouteBuilder.Builder );
            var pipeline = new Pipeline();
            setup(pipeline);
            var appfunc = pipeline.Build();
            app.Use(new Func<AppFunc, AppFunc>(ignored => appfunc));
            return app;
        }
Пример #4
0
        public static IAppBuilder UseYOYOFx(this IAppBuilder app, Action <IRouteBuilder> routebuilderFunc = null, Action <Pipeline> setup = null, Action <YOYOFxOptions> configuration = null)
        {
            YOYOFxOptions options = new YOYOFxOptions();

            if (configuration != null)
            {
                configuration(options);
            }

            options.Bootstrapper.Initialise();



            Application.CurrentApplication.SetOptions(options);

            routebuilderFunc(RouteBuilder.Builder);
            var pipeline = new Pipeline();

            setup(pipeline);
            var appfunc = pipeline.Build();

            app.Use(new Func <AppFunc, AppFunc>(ignored => appfunc));
            return(app);
        }
Пример #5
0
 public void SetOptions(YOYOFxOptions options)
 {
     this.Options = options;
 }
Пример #6
0
 public void SetOptions(YOYOFxOptions options)
 {
     this.Options = options;
 }