static void Main() { EngineBootstrapper boostrapper = new EngineBootstrapper(); boostrapper.Run(); using (Engine engine = new Engine(boostrapper.Kernel)) { engine.Run(); } }
/// <summary> /// Creates mappings of interfaces to concrete objects /// </summary> /// <param name="container"></param> public static void RegisterTypes(IUnityContainer container) { ManagerBootstrapper.RegisterTypes(container); EngineBootstrapper.RegisterTypes(container); AccessorBootstrapper.RegisterTypes(container); // The following would require concrete classes be public //container.RegisterType<IPriceManager, PriceManager>(); //container.RegisterType<IProductParserEngine, ProductParserEngine>(); //container.RegisterType<IWebPageEngine, WebPageEngine>(); //container.RegisterType<IProductAccessor, ProductAccessor>(); //container.RegisterType<IEmailAccessor, EmailAccessor>(); }
static void Main(string[] args) { EngineBootstrapper boostrapper = new EngineBootstrapper(); boostrapper.Run(); IConfiguration config = boostrapper.Container.Resolve<IConfiguration>(); if (!config.FileExists) config.RestoreDefaults(); using (Engine engine = boostrapper.Container.Resolve<Engine>()) { engine.Run(); } }