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); }
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); }
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; }
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); }
public void SetOptions(YOYOFxOptions options) { this.Options = options; }