public void SetUp()
        {
            registry = new FubuRegistry(x =>
            {
                x.Route<InputModel>("area/sub/{Name}/{Age}")
                    .Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Route<InputModel>("area/sub2/prop")
                    .Calls<TestController>(c => c.SomeAction(null)).OutputToJson();

                x.Route<InputModel>("area/sub2/{Name}/{Age}")
                    .Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();

                x.Route<InputModel>("area/sub2/{Name}")
                    .Calls<TestController>(c => c.ThirdAction(null)).OutputToJson();

                x.Route<InputModel>("area/sub3/{Name}/{Age}")
                    .Calls<TestController>(c => c.AnotherAction(null)).OutputToJson();
            });

            container = new Container();

            var bootstrapper = new StructureMapBootstrapper(container, registry);
            routes = new RouteCollection();

            bootstrapper.Bootstrap(routes);

            container.Configure(x => x.For<IOutputWriter>().Use(new InMemoryOutputWriter()));
            Debug.WriteLine(container.WhatDoIHave());
        }
 private static void BootstrapFubu(IContainer container, RouteCollection routes)
 {
     var bootstrapper = new StructureMapBootstrapper(container, new FuBuPlannerRegistry())
                            {
                                Builder = (c, args, id) => new RepositoryBehaviour(c, args, id)
                            };
     bootstrapper.Bootstrap(routes);
 }
        public static IContainer BuildContainer(FubuRegistry registry)
        {
            var container = new Container();
            var bootstrapper = new StructureMapBootstrapper(container, registry);
            bootstrapper.Bootstrap(new List<RouteBase>());

            return container;
        }
Esempio n. 4
0
        public static IContainer BuildContainer(FubuRegistry registry)
        {
            var container    = new Container();
            var bootstrapper = new StructureMapBootstrapper(container, registry);

            bootstrapper.Bootstrap(new List <RouteBase>());

            return(container);
        }
        public static void BootstrapFubu(IContainer container, RouteCollection routes)
        {
            var bootstrapper = new StructureMapBootstrapper(container, new __NAME__Registry());
            bootstrapper.Builder = (c, args, id) =>
            {
                return new TransactionalContainerBehavior(c, args, id);
            };

            bootstrapper.Bootstrap(routes);
        }
        private void BootstrapStructureMap(FubuRegistry fubuRegistry)
        {
            UrlContext.Reset();

            ObjectFactory.Initialize(x =>
                                         {
                                             x.For<ISparkSettings>().Use<SparkSettings>();
                                             x.For(typeof(ISparkViewRenderer<>)).Use(typeof(SparkViewRenderer<>));
                                         });

            var bootstrapper = new StructureMapBootstrapper(ObjectFactory.Container, fubuRegistry);
            bootstrapper.Bootstrap(_routes);
        }
        private void BootstrapStructureMap(FubuRegistry fubuRegistry)
        {
            UrlContext.Reset();

            var fubuBootstrapper = new StructureMapBootstrapper(ObjectFactory.Container, fubuRegistry);
            //fubuBootstrapper.Builder = (c, args, id) =>
            //                               {
            //                                   return new TransactionalContainerBehavior(c, args, id);
            //                               };

            fubuBootstrapper.Bootstrap(_routes);

            ObjectFactory.Container.StartStartables();
        }
        private void BootstrapStructureMap(FubuRegistry fubuRegistry)
        {
            UrlContext.Reset();

            ObjectFactory.Initialize(x =>
                                         {
                                             x.AddRegistry(new __NAME__CoreRegistry());
                                             x.AddRegistry(new __NAME__WebRegistry());
                                         });

            var fubuBootstrapper = new StructureMapBootstrapper(ObjectFactory.Container, fubuRegistry);
            fubuBootstrapper.Builder = (c, args, id) =>
                                           {
                                               return new TransactionalContainerBehavior(c, args, id);
                                           };
            fubuBootstrapper.Bootstrap(_routes);

            ObjectFactory.Container.StartStartables();
        }
        private void BootstrapStructureMap(FubuRegistry fubuRegistry)
        {
            UrlContext.Reset();

            ObjectFactory.Initialize(x =>
                                         {
                                             x.AddRegistry(new KokugenCoreRegistry());
                                             x.AddRegistry(new KokugenWebRegistry());
                                         });

            var fubuBootstrapper = new StructureMapBootstrapper(ObjectFactory.Container, fubuRegistry);
            fubuBootstrapper.Builder = (c, args, id) =>
                                           {
                                               return new TransactionalContainerBehavior(c, args, id);
                                           };
            fubuBootstrapper.Bootstrap(_routes);

            ObjectFactory.Container.StartStartables();

            HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize();
        }
        private void BootstrapStructureMap(FubuRegistry fubuRegistry)
        {
            UrlContext.Reset();

            ObjectFactory.Initialize(x =>
                {

                    x.For<ISparkSettings>()
                        .Use<SparkSettings>();

                    x.For<SparkViewFactory>()
                        .Singleton();

                    x.For<IServiceLocator>()
                        .Use<StructureMapServiceLocator>();

                    x.For<ISessionState>()
                        .Use<SimpleSessionState>();

                    x.For(typeof (ISparkViewRenderer<>))
                        .Use(typeof (SparkViewRenderer<>));

                    x.For<ISparkViewBuilder>()
                        .Use<StructuremapSparkViewBuilder>();

                    x.For<ISparkSettingsFactory>()
                        .Use<SparkSettingsFactory>();

                    x.SetAllProperties(s =>
                        {
                            s.Matching(p => p.DeclaringType == typeof(FubuSparkPageView));
                            s.OfType<IServiceLocator>();
                        });
                });

            var bootstrapper = new StructureMapBootstrapper(ObjectFactory.Container, fubuRegistry);
            bootstrapper.Bootstrap(_routes);
        }
 private void BootstrapStructureMap(FubuRegistry fubuRegistry)
 {
     UrlContext.Reset();
     var bootstrapper = new StructureMapBootstrapper(ObjectFactory.Container, fubuRegistry);
     bootstrapper.Bootstrap(_routes);
 }
 public static void InitializeFubuApplication(this IContainer container, FubuRegistry fubuRegistry, ICollection<RouteBase> routes)
 {
     var bootstrapper = new StructureMapBootstrapper(container, fubuRegistry);
     bootstrapper.Bootstrap(routes);
 }
 private static void BootstrapFubu(IContainer container, RouteCollection routes)
 {
     var bootstrapper = new StructureMapBootstrapper(container, new PolyphonyFubuRegistry());
     bootstrapper.Bootstrap(routes);
 }
Esempio n. 14
0
        public static void InitializeFubuApplication(this IContainer container, FubuRegistry fubuRegistry, ICollection <RouteBase> routes)
        {
            var bootstrapper = new StructureMapBootstrapper(container, fubuRegistry);

            bootstrapper.Bootstrap(routes);
        }