private static void Main(string[] args) { LoggingUtils.InitializeLogging(true); Console.WriteLine("Loading Configuration..."); Bootstrapper.With.StructureMap() .And.ServiceLocator() .LookForTypesIn.ReferencedAssemblies() .Including.Assembly(Assembly.GetAssembly(typeof(FrameworkContainer))) .AndAssembly(Assembly.GetAssembly(typeof(DataCollectorContainer))) .AndAssembly(Assembly.GetAssembly(typeof(DataPusherContainer))) .AndAssembly(Assembly.GetAssembly(typeof(WorkerRole))) .AndAssembly(Assembly.GetAssembly(typeof(FaclityDataProcessorContainer))) //.With.StartupTasks() .Start(); _container = (IContainer)Bootstrapper.Container; //This is just for intellisense when stepping through... var what = _container.WhatDoIHave(); //Ensure our IoC is happy //_container.AssertConfigurationIsValid(); Log.Debug("IoC configuration is valid"); DisplayMenu(); }
public override bool OnStart() { LoggingUtils.InitializeLogging(); Bootstrapper.With.StructureMap() .And.ServiceLocator() .LookForTypesIn.ReferencedAssemblies() .Including.Assembly(Assembly.GetAssembly(typeof(FrameworkContainer))) .Including.Assembly(Assembly.GetAssembly(typeof(DataCollectorContainer))) .Including.Assembly(Assembly.GetAssembly(typeof(DataPusherContainer))) .Including.Assembly(Assembly.GetAssembly(typeof(WorkerRole))) .Start(); var container = ServiceLocator.Current; var eventHubProcessor = container.GetInstance <EventHubProcessor>(); eventHubProcessor.Run(); return(base.OnStart()); }