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); }
//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)); }
static MvcApplication() { // Register the IoC that you want Mvc Turbine to use! // Everything else is wired automatically ServiceLocatorManager.SetLocatorProvider(() => new UnityServiceLocator()); }
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()); }
//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)); }
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()); }
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()); }
/// <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); }
public void Null_Provider_Throws_InvalidOperation_Exception() { ServiceLocatorManager.SetLocatorProvider(null); var locator = ServiceLocatorManager.Current; }
//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())); }
static MvcApplication() { // Now tell the engine to use the Windsor locator ServiceLocatorManager.SetLocatorProvider(() => new MvcTurbine.Windsor.WindsorServiceLocator()); }
static MvcApplication() { ServiceLocatorManager.SetLocatorProvider(() => new NinjectServiceLocator()); }
/// <summary> /// Performs any startup processing. /// </summary> public override void Startup() { ServiceLocatorManager.SetLocatorProvider(() => new TurbineServiceLocatorAbstractor()); base.Startup(); }
//NOTE: You want to hit this piece of code only once. static DefaultMvcApplication() { var container = CreateContainer(); ServiceLocatorManager.SetLocatorProvider(() => new WindsorServiceLocator(container)); }
static MvcApplication() { ServiceLocatorManager.SetLocatorProvider(() => new WindsorServiceLocator()); }
static MvcApplication() { ServiceLocatorManager.SetLocatorProvider(() => new StructureMapServiceLocator()); }