static MvcApplication()
        {
            DatabaseFactory.SetConnectionName("Mongo");

            var container = new UnityContainer();

            ServiceLocatorManager.SetLocatorProvider(() => new UnityServiceLocator(container));

            var simpleCqrsRuntime = new SimpleCqrsRuntime(container);

            simpleCqrsRuntime.Start();

            simpleCqrsRuntime.ServiceLocator.Register <IEventStore>(
                new SqlServerEventStore(
                    new SqlServerConfiguration(ConfigurationManager.ConnectionStrings["Bennington.ContentTree.Domain.ConnectionString"].ToString()),
                    new JsonDomainEventSerializer()));

            container.RegisterInstance(simpleCqrsRuntime.ServiceLocator.Resolve <ICommandBus>());
            container.RegisterInstance <SimpleCqrs.IServiceLocator>(simpleCqrsRuntime.ServiceLocator);

            Configurer.Configure
            .Content()
            .UseSql("Bennington.ContentTree.Domain.ConnectionString")
            .Run();
        }
        public MvcApplication()
        {
            var locator = new UnityServiceLocator();

            locator.Register <IServiceLocator>(locator);
            ServiceLocatorManager.SetLocatorProvider(() => locator);
        }
Beispiel #3
0
        //NOTE: You want to hit this piece of code only once.
        static DefaultMvcApplication()
        {
            //TODO: Specify your own service locator here.
            var container = CreateContainer();

            ServiceLocatorManager.SetLocatorProvider(() => new StructureMapServiceLocator(container));
        }
Beispiel #4
0
        static MvcApplication()
        {
            // Register the IoC that you want Mvc Turbine to use!
            // Everything else is wired automatically

            ServiceLocatorManager.SetLocatorProvider(() => new UnityServiceLocator());
        }
Beispiel #5
0
        public void Empty_Provider_Return_Null_Provider()
        {
            ServiceLocatorManager.SetLocatorProvider(() => null);

            IServiceLocator locator = ServiceLocatorManager.Current;

            Assert.IsNull(locator);
        }
 public MvcApplication()
 {
     ServiceLocatorManager.SetLocatorProvider(() => new HiroServiceLocator());
     //ServiceLocatorManager.SetLocatorProvider(() => new StructureMapServiceLocator());
     //ServiceLocatorManager.SetLocatorProvider(() => new UnityServiceLocator());
     //ServiceLocatorManager.SetLocatorProvider(() => new WindsorServiceLocator());
     //ServiceLocatorManager.SetLocatorProvider(() => new NinjectServiceLocator());
 }
Beispiel #7
0
        //NOTE: You want to hit this piece of code only once.
        static DefaultMvcApplication()
        {
            // Initialize the Ninject Kernel
            IKernel kernel = InitializeNinject();

            // Tell the MVC Turbine runtime to use the initialized kernel
            ServiceLocatorManager.SetLocatorProvider(() => new NinjectServiceLocator(kernel));
        }
Beispiel #8
0
        static MvcApplication()
        {
            // Register the IoC that you want Mvc Turbine to use!
            // Everything else is wired automatically

            // For now, let's use the Unity IoC
            ServiceLocatorManager.SetLocatorProvider(() => new NinjectServiceLocator());
        }
Beispiel #9
0
        static MvcApplication()
        {
            // Register the IoC that you want Mvc Turbine to use!
            // Everything else is wired automatically

            // For now, let's use the Castle Windsor IoC since it will resolve the view engine's
            // default constructor
            ServiceLocatorManager.SetLocatorProvider(() => new WindsorServiceLocator());
        }
Beispiel #10
0
 /// <summary>
 /// Static constructor.
 /// </summary>
 static OkonauApplication()
 {
     // Specify the Windsor IoC to use with the application.
     ServiceLocatorManager.SetLocatorProvider(() => new WindsorServiceLocator());
 }
 public MvcApplication()
 {
     ServiceLocatorManager.SetLocatorProvider(() => new UnityServiceLocator());
     this.AuthenticateRequest += new EventHandler(Application_AuthenticateRequest);
 }
Beispiel #12
0
        public void Null_Provider_Throws_InvalidOperation_Exception()
        {
            ServiceLocatorManager.SetLocatorProvider(null);

            var locator = ServiceLocatorManager.Current;
        }
Beispiel #13
0
 //NOTE: You want to hit this piece of code only once.
 static DefaultMvcApplication()
 {
     //TODO: Specify your own service locator here.
     ServiceLocatorManager.SetLocatorProvider(() => new WindsorServiceLocator());
 }
 //NOTE: You want to hit this piece of code only once.
 static DefaultMvcApplication()
 {
     ServiceLocatorManager.SetLocatorProvider(() => new UnityServiceLocator(CreateContainer()));
 }
Beispiel #15
0
 static MvcApplication()
 {
     // Now tell the engine to use the Windsor locator
     ServiceLocatorManager.SetLocatorProvider(() => new MvcTurbine.Windsor.WindsorServiceLocator());
 }
Beispiel #16
0
 static MvcApplication()
 {
     ServiceLocatorManager.SetLocatorProvider(() => new NinjectServiceLocator());
 }
 /// <summary>
 /// Performs any startup processing.
 /// </summary>
 public override void Startup()
 {
     ServiceLocatorManager.SetLocatorProvider(() => new TurbineServiceLocatorAbstractor());
     base.Startup();
 }
Beispiel #18
0
        //NOTE: You want to hit this piece of code only once.
        static DefaultMvcApplication()
        {
            var container = CreateContainer();

            ServiceLocatorManager.SetLocatorProvider(() => new WindsorServiceLocator(container));
        }
Beispiel #19
0
 static MvcApplication()
 {
     ServiceLocatorManager.SetLocatorProvider(() => new WindsorServiceLocator());
 }
Beispiel #20
0
 static MvcApplication()
 {
     ServiceLocatorManager.SetLocatorProvider(() => new StructureMapServiceLocator());
 }